1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

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.
This commit is contained in:
thankyouverycool 2022-08-12 19:34:04 -04:00 committed by Andreas Kling
parent db058a22ae
commit 9bcd7dc0ce
4 changed files with 6 additions and 2 deletions

View file

@ -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;