From b9be57a9cda4b83523f14d2998cce210cbf84d77 Mon Sep 17 00:00:00 2001 From: angel Date: Tue, 21 Apr 2020 16:20:50 +0200 Subject: [PATCH] WindowServer: Don't process menu bar events when modal is open This prevents accesing the parent window menubar when a modal is currently open, which was not a desired behavior. --- Servers/WindowServer/MenuManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Servers/WindowServer/MenuManager.cpp b/Servers/WindowServer/MenuManager.cpp index 6043ee6aa6..a0a1261770 100644 --- a/Servers/WindowServer/MenuManager.cpp +++ b/Servers/WindowServer/MenuManager.cpp @@ -147,11 +147,12 @@ void MenuManager::event(Core::Event& event) void MenuManager::handle_mouse_event(MouseEvent& mouse_event) { + auto* active_window = WindowManager::the().active_window(); bool handled_menubar_event = false; for_each_active_menubar_menu([&](Menu& menu) { if (menu.rect_in_menubar().contains(mouse_event.position())) { handle_menu_mouse_event(menu, mouse_event); - handled_menubar_event = true; + handled_menubar_event = !active_window || !active_window->is_modal(); return IterationDecision::Break; } return IterationDecision::Continue;