From 6b52f6c61db3b81f44c83be55aeddaccbd580ee8 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 18 Jan 2020 12:13:55 +1300 Subject: [PATCH] WindowServer: Fix windowswitcher not closing, make system menu a toggle We were swallowing the keyevent on a Logo key down even if we were not opening the logo. This is incorrect, and was preventing the windowswitcher from closing. We also make the logo button toggle the system menu, as this behaviour is closer to how you would normally expect this button to work. Closes #1090 --- Servers/WindowServer/WSWindowManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp index 4584521a18d..829ff8d6577 100644 --- a/Servers/WindowServer/WSWindowManager.cpp +++ b/Servers/WindowServer/WSWindowManager.cpp @@ -944,9 +944,11 @@ void WSWindowManager::event(CEvent& event) if (key_event.key() == Key_Logo) { if (key_event.type() == WSEvent::KeyUp) { - if (!m_moved_or_resized_since_logo_keydown && !m_switcher.is_visible() && !m_move_window && !m_resize_window) - WSMenuManager::the().open_menu(WSMenuManager::the().system_menu()); - return; + if (!m_moved_or_resized_since_logo_keydown && !m_switcher.is_visible() && !m_move_window && !m_resize_window) { + WSMenuManager::the().toggle_menu(WSMenuManager::the().system_menu()); + return; + } + } else if (key_event.type() == WSEvent::KeyDown) { m_moved_or_resized_since_logo_keydown = false; }