mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:27:44 +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
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