浏览代码

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 年之前
父节点
当前提交
6b52f6c61d
共有 1 个文件被更改,包括 5 次插入3 次删除
  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.key() == Key_Logo) {
             if (key_event.type() == WSEvent::KeyUp) {
             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) {
             } else if (key_event.type() == WSEvent::KeyDown) {
                 m_moved_or_resized_since_logo_keydown = false;
                 m_moved_or_resized_since_logo_keydown = false;
             }
             }