From fefc2665d6d5cc5a311b5e4ffe7d7c409fd18dae Mon Sep 17 00:00:00 2001 From: Alex Muscar Date: Wed, 25 Mar 2020 15:26:33 +0000 Subject: [PATCH] WindowServer: Don't ignore mouse events after showing modal window (#1495) Fixes #1464 --- Servers/WindowServer/MenuManager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Servers/WindowServer/MenuManager.cpp b/Servers/WindowServer/MenuManager.cpp index 39ae0f78d7..6c371e7aff 100644 --- a/Servers/WindowServer/MenuManager.cpp +++ b/Servers/WindowServer/MenuManager.cpp @@ -120,8 +120,14 @@ void MenuManager::refresh() void MenuManager::event(Core::Event& event) { - if (WindowManager::the().active_window_is_modal()) - return Core::Object::event(event); + auto* active_window = WindowManager::the().active_window(); + if (active_window && active_window->is_modal() && has_open_menu()) { + auto* topmost_menu = m_open_menu_stack.last().ptr(); + ASSERT(topmost_menu); + // Always allow window menu interaction, even while a modal window is active. + if (!topmost_menu->window_menu_of()) + return Core::Object::event(event); + } if (static_cast(event).is_mouse_event()) { handle_mouse_event(static_cast(event));