diff --git a/Libraries/LibCore/CObject.cpp b/Libraries/LibCore/CObject.cpp index efdd70ad1c..8e15383428 100644 --- a/Libraries/LibCore/CObject.cpp +++ b/Libraries/LibCore/CObject.cpp @@ -189,6 +189,11 @@ void CObject::dispatch_event(CEvent& e, CObject* stay_within) do { target->event(e); target = target->parent(); + if (target == stay_within) { + // Prevent the event from bubbling any further. + e.accept(); + break; + } } while (target && target != stay_within && !e.is_accepted()); }