summaryrefslogtreecommitdiff
path: root/Servers
diff options
context:
space:
mode:
authorjoshua stein <jcs@jcs.org>2019-12-30 21:06:21 -0600
committerAndreas Kling <awesomekling@gmail.com>2019-12-31 04:23:08 +0100
commit5b1f8ce220bdceb06076d415689832fa9e5022db (patch)
treef5533b9f742a15f0b692a1eb5329d428b9666eaf /Servers
parentf908ee34963a841f105f886e3769d6b337faa4ef (diff)
downloadserenity-5b1f8ce220bdceb06076d415689832fa9e5022db.zip
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.
Diffstat (limited to 'Servers')
-rw-r--r--Servers/WindowServer/WSWindowManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp
index b76234213d..d40d38ea20 100644
--- a/Servers/WindowServer/WSWindowManager.cpp
+++ b/Servers/WindowServer/WSWindowManager.cpp
@@ -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) {