1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:27:45 +00:00

WindowServer: set no menu bar when last window is removed

This is done here rather than pick_new_active_window() so that when
there are no other windows to focus but the previous window hasn't
been removed (just minimized), the menu bar remains on that client.
This commit is contained in:
joshua stein 2019-12-30 21:06:21 -06:00 committed by Andreas Kling
parent f908ee3496
commit 5b1f8ce220

View file

@ -348,6 +348,8 @@ void WSWindowManager::remove_window(WSWindow& window)
m_windows_in_order.remove(&window);
if (window.is_active())
pick_new_active_window();
if (m_active_window.ptr() == &window)
set_active_window(nullptr);
if (m_switcher.is_visible() && window.type() != WSWindowType::WindowSwitcher)
m_switcher.refresh();
@ -1122,6 +1124,8 @@ void WSWindowManager::set_active_window(WSWindow* window)
ASSERT(client);
set_current_menubar(client->app_menubar());
tell_wm_listeners_window_state_changed(*m_active_window);
} else {
set_current_menubar(nullptr);
}
if (active_client != previously_active_client) {