summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorDragonAlex98 <37349526+DragonAlex98@users.noreply.github.com>2021-02-07 12:28:42 +0100
committerGitHub <noreply@github.com>2021-02-07 12:28:42 +0100
commit885974fc3c8616a6325637afdb00cff9a17b1b51 (patch)
tree0eee6787eb358a0fde5f91319a02571586c12106 /Userland/Services
parentd107cabf5d1321621d69aa1e3f858a9fe3684fe7 (diff)
downloadserenity-885974fc3c8616a6325637afdb00cff9a17b1b51.zip
WindowServer: Don't close menu when clicking on item with submenu (#5239)
When clicking on a menu item with a submenu, don't close the menu.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WindowServer/MenuManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/MenuManager.cpp b/Userland/Services/WindowServer/MenuManager.cpp
index 8069383abf..fb985c8609 100644
--- a/Userland/Services/WindowServer/MenuManager.cpp
+++ b/Userland/Services/WindowServer/MenuManager.cpp
@@ -242,6 +242,13 @@ void MenuManager::handle_mouse_event(MouseEvent& mouse_event)
}
if (mouse_event.type() == Event::MouseDown) {
+ for (auto& menu : m_open_menu_stack) {
+ if (!menu)
+ continue;
+ if (!menu->menu_window()->rect().contains(mouse_event.position()))
+ continue;
+ return;
+ }
close_bar();
topmost_menu->set_window_menu_open(false);
}