Browse Source

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
Shannon Booth 5 years ago
parent
commit
6b52f6c61d
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Servers/WindowServer/WSWindowManager.cpp

+ 5 - 3
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;
             }