mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
WindowServer: Process dnd mouse events first
Fixes duplicate GUI::DragOperation instances being created. Fixes #3151
This commit is contained in:
parent
8e97de2df9
commit
f503d3c046
Notes:
sideshowbarker
2024-07-19 03:25:20 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/f503d3c0468 Pull-request: https://github.com/SerenityOS/serenity/pull/3216 Issue: https://github.com/SerenityOS/serenity/issues/3151
1 changed files with 5 additions and 3 deletions
|
@ -874,6 +874,11 @@ void WindowManager::process_mouse_event(MouseEvent& event, Window*& hovered_wind
|
|||
{
|
||||
HashTable<Window*> windows_who_received_mouse_event_due_to_cursor_tracking;
|
||||
|
||||
// We need to process ongoing drag events first. Otherwise, global tracking
|
||||
// and dnd collides, leading to duplicate GUI::DragOperation instances
|
||||
if (process_ongoing_drag(event, hovered_window))
|
||||
return;
|
||||
|
||||
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
|
||||
if (!window->global_cursor_tracking() || !window->is_visible() || window->is_minimized() || window->is_blocked_by_modal_window())
|
||||
continue;
|
||||
|
@ -884,9 +889,6 @@ void WindowManager::process_mouse_event(MouseEvent& event, Window*& hovered_wind
|
|||
|
||||
hovered_window = nullptr;
|
||||
|
||||
if (process_ongoing_drag(event, hovered_window))
|
||||
return;
|
||||
|
||||
if (process_ongoing_window_move(event, hovered_window))
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue