From 20f53c746267dd24629eec27cfc34f4b648b62d3 Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 15 Jan 2021 20:52:06 -0700 Subject: [PATCH] LibGUI: Don't bubble window events up to parent windows Always accept the events so that they don't bubble up to the parent object. Fixes #4967 --- Userland/Libraries/LibGUI/Window.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 690b62746b..c874d74c42 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -490,6 +491,10 @@ void Window::handle_left_event() void Window::event(Core::Event& event) { + ScopeGuard guard([&] { + // Accept the event so it doesn't bubble up to parent windows! + event.accept(); + }); if (event.type() == Event::Drop) return handle_drop_event(static_cast(event));