mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:27:45 +00:00
WindowServer: Add menus to open menu stack before making them visible
This prevents an issue where the first mouse event in a newly opened would not get handled because we didn't think the menu was open yet.
This commit is contained in:
parent
239520ae54
commit
7a1a8d267d
1 changed files with 2 additions and 2 deletions
|
@ -296,6 +296,8 @@ void MenuManager::open_menu(Menu& menu, bool as_current_menu)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_open_menu_stack.append(menu);
|
||||||
|
|
||||||
if (!menu.is_empty()) {
|
if (!menu.is_empty()) {
|
||||||
menu.redraw_if_theme_changed();
|
menu.redraw_if_theme_changed();
|
||||||
auto* window = menu.menu_window();
|
auto* window = menu.menu_window();
|
||||||
|
@ -303,8 +305,6 @@ void MenuManager::open_menu(Menu& menu, bool as_current_menu)
|
||||||
window->set_visible(true);
|
window->set_visible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_open_menu_stack.append(menu);
|
|
||||||
|
|
||||||
if (as_current_menu || !current_menu()) {
|
if (as_current_menu || !current_menu()) {
|
||||||
// Only make this menu the current menu if requested, or if no
|
// Only make this menu the current menu if requested, or if no
|
||||||
// other menu is current
|
// other menu is current
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue