mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-29 06:22:53 +00:00
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.
This commit is contained in:
parent
d107cabf5d
commit
885974fc3c
Notes:
sideshowbarker
2024-07-18 22:32:54 +09:00
Author: https://github.com/DragonAlex98 🔰
Commit: 885974fc3c
Pull-request: https://github.com/SerenityOS/serenity/pull/5239
1 changed files with 7 additions and 0 deletions
|
@ -242,6 +242,13 @@ void MenuManager::handle_mouse_event(MouseEvent& mouse_event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouse_event.type() == Event::MouseDown) {
|
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();
|
close_bar();
|
||||||
topmost_menu->set_window_menu_open(false);
|
topmost_menu->set_window_menu_open(false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue