summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-22 06:42:27 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-22 11:00:44 +0200
commitf1ac0b6a5ae6c97ea572e46b1707d2f75ecb6d60 (patch)
tree6ab708fd75542bc8f50be9d7fe672a7a81cf632b /Userland
parent20b2c46019552894dba84cd9802cad42cedac8c7 (diff)
downloadserenity-f1ac0b6a5ae6c97ea572e46b1707d2f75ecb6d60.zip
WindowServer: Send events once when global cursor tracking is enabled
Previously we'd send mouse events twice if the target window had global cursor tracking enabled.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Services/WindowServer/WindowManager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp
index 9e942ec4db..2544551709 100644
--- a/Userland/Services/WindowServer/WindowManager.cpp
+++ b/Userland/Services/WindowServer/WindowManager.cpp
@@ -1007,8 +1007,10 @@ void WindowManager::process_mouse_event(MouseEvent& event)
return;
// 2. Send the mouse event to all windows with global cursor tracking enabled.
+ // The active input tracking window is excluded here because we're sending the event to it
+ // in the next step.
m_window_stack.for_each_visible_window_from_front_to_back([&](Window& window) {
- if (window.global_cursor_tracking())
+ if (window.global_cursor_tracking() && &window != m_active_input_tracking_window)
deliver_mouse_event(window, event, false);
return IterationDecision::Continue;
});