浏览代码

LibGUI: Ignore application-global shortcuts in modal windows

This is making me question the usefulness of application-global
shortcuts, but for now let's just prevent them from triggering while
you're looking at a modal message box..
Andreas Kling 4 年之前
父节点
当前提交
50aa726db7
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Libraries/LibGUI/WindowServerConnection.cpp

+ 2 - 1
Libraries/LibGUI/WindowServerConnection.cpp

@@ -165,7 +165,8 @@ void WindowServerConnection::handle(const Messages::WindowClient::KeyDown& messa
 #endif
     }
 
-    if (!action) {
+    // NOTE: Application-global shortcuts are ignored while a modal window is up.
+    if (!action && !window->is_modal()) {
         action = Application::the()->action_for_key_event(*key_event);
 #ifdef KEYBOARD_SHORTCUTS_DEBUG
         dbg() << "  > Asked application, got action: " << action;