mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-16 04:42:57 +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
|
@ -296,6 +296,8 @@ void MenuManager::open_menu(Menu& menu, bool as_current_menu)
|
|||
return;
|
||||
}
|
||||
|
||||
m_open_menu_stack.append(menu);
|
||||
|
||||
if (!menu.is_empty()) {
|
||||
menu.redraw_if_theme_changed();
|
||||
auto* window = menu.menu_window();
|
||||
|
@ -303,8 +305,6 @@ void MenuManager::open_menu(Menu& menu, bool as_current_menu)
|
|||
window->set_visible(true);
|
||||
}
|
||||
|
||||
m_open_menu_stack.append(menu);
|
||||
|
||||
if (as_current_menu || !current_menu()) {
|
||||
// Only make this menu the current menu if requested, or if no
|
||||
// other menu is current
|
||||
|
|
Loading…
Reference in a new issue