summaryrefslogtreecommitdiff
path: root/Libraries/LibCore
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-09 00:01:11 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-09 12:02:07 +0100
commitdbd090fd956e23014b52d95a5a9e788ee480af58 (patch)
tree962ff388b8ae33a01e688a7de2a5a0dbb78683ca /Libraries/LibCore
parent094b47971b79035b703e43a573fb3073b25ab311 (diff)
downloadserenity-dbd090fd956e23014b52d95a5a9e788ee480af58.zip
LibCore: Don't auto-accept events that hit bubbling limit
We were using the "accept" flag on the event to break out of the bubbling loop, but this had lasting consequences since all events that bubbled too far came out looking as if someone had accepted them. If an event is ignored by everyone, it should appear ignored.
Diffstat (limited to 'Libraries/LibCore')
-rw-r--r--Libraries/LibCore/Object.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Libraries/LibCore/Object.cpp b/Libraries/LibCore/Object.cpp
index dd627fb8cc..27d5985d00 100644
--- a/Libraries/LibCore/Object.cpp
+++ b/Libraries/LibCore/Object.cpp
@@ -231,8 +231,7 @@ void Object::dispatch_event(Core::Event& e, Object* stay_within)
target = target->parent();
if (target == stay_within) {
// Prevent the event from bubbling any further.
- e.accept();
- break;
+ return;
}
} while (target && !e.is_accepted());
}