diff options
Diffstat (limited to 'Userland/Services/WindowServer')
-rw-r--r-- | Userland/Services/WindowServer/WindowManager.cpp | 17 | ||||
-rw-r--r-- | Userland/Services/WindowServer/WindowManager.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index d9b3c729a3..8471910c98 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -1087,6 +1087,9 @@ Gfx::IntRect WindowManager::arena_rect_for_type(WindowType type) const void WindowManager::event(Core::Event& event) { if (static_cast<Event&>(event).is_mouse_event()) { + if (event.type() != Event::MouseMove) + m_previous_event_is_key_down_logo = false; + Window* hovered_window = nullptr; process_mouse_event(static_cast<MouseEvent&>(event), hovered_window); set_hovered_window(hovered_window); @@ -1116,6 +1119,20 @@ void WindowManager::event(Core::Event& event) return; } + if (key_event.type() == Event::KeyDown && key_event.key() == Key_Logo) { + m_previous_event_is_key_down_logo = true; + } else if (m_previous_event_is_key_down_logo) { + m_previous_event_is_key_down_logo = false; + if (key_event.type() == Event::KeyUp && key_event.key() == Key_Logo) { + if (MenuManager::the().has_open_menu()) { + MenuManager::the().close_everyone(); + } else { + MenuManager::the().open_menu(*MenuManager::the().system_menu()); + } + return; + } + } + if (MenuManager::the().current_menu()) { MenuManager::the().dispatch_event(event); return; diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h index 21cb345f85..84673fd0f5 100644 --- a/Userland/Services/WindowServer/WindowManager.h +++ b/Userland/Services/WindowServer/WindowManager.h @@ -353,6 +353,8 @@ private: String m_dnd_text; RefPtr<Core::MimeData> m_dnd_mime_data; RefPtr<Gfx::Bitmap> m_dnd_bitmap; + + bool m_previous_event_is_key_down_logo { false }; }; template<typename Callback> |