From dbd090fd956e23014b52d95a5a9e788ee480af58 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 9 Jan 2021 00:01:11 +0100 Subject: [PATCH] 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. --- Libraries/LibCore/Object.cpp | 3 +-- 1 file changed, 1 insertion(+), 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()); }