summaryrefslogtreecommitdiff
path: root/WindowServer
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-03 12:56:48 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-03 12:56:48 +0100
commit57fe316e01f6db046f04eff89adcf974c5c867a1 (patch)
tree5250872882263665b99111ea869e39f204adfd9e /WindowServer
parent159fa99539868db50162115b3155a12967e89555 (diff)
downloadserenity-57fe316e01f6db046f04eff89adcf974c5c867a1.zip
Detect the "Logo" (Windows/Apple/whatever) key and use it for window resize.
This will be comfortable enough while I'm still developing with emulators. QEMU keeps eating my "Alt" key presses and it's making things difficult.
Diffstat (limited to 'WindowServer')
-rw-r--r--WindowServer/WSMessage.h1
-rw-r--r--WindowServer/WSWindowManager.cpp3
-rw-r--r--WindowServer/WSWindowManager.h2
3 files changed, 5 insertions, 1 deletions
diff --git a/WindowServer/WSMessage.h b/WindowServer/WSMessage.h
index 9981eb19af..0dd4dd910b 100644
--- a/WindowServer/WSMessage.h
+++ b/WindowServer/WSMessage.h
@@ -463,6 +463,7 @@ public:
bool ctrl() const { return m_modifiers & Mod_Ctrl; }
bool alt() const { return m_modifiers & Mod_Alt; }
bool shift() const { return m_modifiers & Mod_Shift; }
+ bool logo() const { return m_modifiers & Mod_Logo; }
byte modifiers() const { return m_modifiers; }
char character() const { return m_character; }
diff --git a/WindowServer/WSWindowManager.cpp b/WindowServer/WSWindowManager.cpp
index 0913c09b14..786d2b4778 100644
--- a/WindowServer/WSWindowManager.cpp
+++ b/WindowServer/WSWindowManager.cpp
@@ -756,7 +756,7 @@ void WSWindowManager::process_mouse_event(WSMouseEvent& event, WSWindow*& event_
move_to_front(window);
set_active_window(&window);
}
- if (event.type() == WSMessage::MouseDown && event.button() == MouseButton::Right) {
+ if (m_keyboard_modifiers == Mod_Logo && event.type() == WSMessage::MouseDown && event.button() == MouseButton::Right) {
start_window_resize(window, event);
return IterationDecision::Abort;
}
@@ -984,6 +984,7 @@ void WSWindowManager::on_message(WSMessage& message)
if (message.is_key_event()) {
// FIXME: This is a good place to hook key events globally. :)
+ m_keyboard_modifiers = static_cast<WSKeyEvent&>(message).modifiers();
if (m_active_window)
return m_active_window->on_message(message);
return;
diff --git a/WindowServer/WSWindowManager.h b/WindowServer/WSWindowManager.h
index 9ac5db19ae..c1f60cbe04 100644
--- a/WindowServer/WSWindowManager.h
+++ b/WindowServer/WSWindowManager.h
@@ -150,6 +150,8 @@ private:
bool m_flash_flush { false };
bool m_buffers_are_flipped { false };
+ byte m_keyboard_modifiers { 0 };
+
OwnPtr<WSMenu> m_system_menu;
Color m_menu_selection_color;
WeakPtr<WSMenuBar> m_current_menubar;