mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 10:41:30 +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: e6c826ffc3
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)
|
void WSMenuManager::set_current_menu(WSMenu* menu, bool is_submenu)
|
||||||
{
|
{
|
||||||
if (!is_submenu)
|
if (!is_submenu) {
|
||||||
close_everyone();
|
if (menu)
|
||||||
|
close_everyone_not_in_lineage(*menu);
|
||||||
|
else
|
||||||
|
close_everyone();
|
||||||
|
}
|
||||||
|
|
||||||
if (!menu) {
|
if (!menu) {
|
||||||
m_current_menu = nullptr;
|
m_current_menu = nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue