mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
WindowServer: Fix non-submenus being closed when set as current menu
set_current_menu() was indiscriminately closing all menus when the current menu is not a submenu. We should only close menus not in lineage to the one being closed.
This commit is contained in:
parent
4f6b9b64c3
commit
e6c826ffc3
Notes:
sideshowbarker
2024-07-19 10:09:16 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/e6c826ffc3b Pull-request: https://github.com/SerenityOS/serenity/pull/1055
1 changed files with 6 additions and 2 deletions
|
@ -389,8 +389,12 @@ void WSMenuManager::open_menu(WSMenu& menu)
|
|||
|
||||
void WSMenuManager::set_current_menu(WSMenu* menu, bool is_submenu)
|
||||
{
|
||||
if (!is_submenu)
|
||||
close_everyone();
|
||||
if (!is_submenu) {
|
||||
if (menu)
|
||||
close_everyone_not_in_lineage(*menu);
|
||||
else
|
||||
close_everyone();
|
||||
}
|
||||
|
||||
if (!menu) {
|
||||
m_current_menu = nullptr;
|
||||
|
|
Loading…
Reference in a new issue