Prechádzať zdrojové kódy

WindowServer: Open window menu on Alt+Space

Adds a keyboard shortcut Alt+Space that opens the window menu.
Eric Butler 4 rokov pred
rodič
commit
5d14636b95
1 zmenil súbory, kde vykonal 5 pridanie a 0 odobranie
  1. 5 0
      Userland/Services/WindowServer/Window.cpp

+ 5 - 0
Userland/Services/WindowServer/Window.cpp

@@ -454,6 +454,11 @@ void Window::event(Core::Event& event)
 
 void Window::handle_keydown_event(const KeyEvent& event)
 {
+    if (event.modifiers() == Mod_Alt && event.key() == Key_Space && type() == WindowType::Normal && !is_frameless()) {
+        auto position = frame().titlebar_rect().bottom_left().translated(frame().rect().location());
+        popup_window_menu(position, WindowMenuDefaultAction::Close);
+        return;
+    }
     if (event.modifiers() == Mod_Alt && event.code_point() && menubar()) {
         Menu* menu_to_open = nullptr;
         menubar()->for_each_menu([&](Menu& menu) {