WindowServer: Open window menu on Alt+Space

Adds a keyboard shortcut Alt+Space that opens the window menu.
This commit is contained in:
Eric Butler 2021-05-08 19:55:56 -04:00 committed by Andreas Kling
parent 967cd6afd2
commit 5d14636b95
Notes: sideshowbarker 2024-07-19 17:27:47 +09:00

View File

@ -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) {