diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2022-08-12 19:34:04 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-16 16:43:27 +0200 |
commit | 9bcd7dc0ce9ceae1808072921653430011f4b2fc (patch) | |
tree | ac4da4a6cb48518d963608bf3f7192d0e2c99e45 /Userland/Services/WindowServer/WindowManager.cpp | |
parent | db058a22aeeadc22539e3e1efd9216970eebdd19 (diff) | |
download | serenity-9bcd7dc0ce9ceae1808072921653430011f4b2fc.zip |
WindowServer: Don't start a drag and drop unless holding Primary mouse
Adds a member to record the last processed mouse buttons. If they
do not include MouseButton::Primary, return early before creating
a new drag and drop client. This fixes race conditions in which
MouseUp events canceling or completing a drop could be swallowed
by Overlay creation or postponed by an executing DragOperation,
leaving the operation in limbo.
Diffstat (limited to 'Userland/Services/WindowServer/WindowManager.cpp')
-rw-r--r-- | Userland/Services/WindowServer/WindowManager.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 0d46f9a98e..f3359c8b27 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -1459,6 +1459,7 @@ void WindowManager::event(Core::Event& event) m_previous_event_was_super_keydown = false; process_mouse_event(mouse_event); + m_last_processed_buttons = mouse_event.buttons(); // TODO: handle transitioning between two stacks set_hovered_window(current_window_stack().window_at(mouse_event.position(), WindowStack::IncludeWindowFrame::No)); return; |