WindowServer: Fix double click handling while using cursor tracking

We need to first deliver the mouse event and possibly the double click
event and record these facts. Then, we need to iterate all global
tracking listeners and deliver the mouse event (but not the double
click event) to any such listener, unless they already had these
events delivered.

Fixes #4703
This commit is contained in:
Tom 2021-02-14 13:48:28 -07:00 committed by Andreas Kling
commit be48a89b35
Notes: sideshowbarker 2024-07-18 22:15:57 +09:00
3 changed files with 23 additions and 22 deletions

View file

@ -225,7 +225,7 @@ void MenuManager::handle_mouse_event(MouseEvent& mouse_event)
if (event_is_inside_current_menu) {
WindowManager::the().set_hovered_window(window);
auto translated_event = mouse_event.translated(-window->position());
WindowManager::the().deliver_mouse_event(*window, translated_event);
WindowManager::the().deliver_mouse_event(*window, translated_event, true);
return;
}
@ -262,7 +262,7 @@ void MenuManager::handle_mouse_event(MouseEvent& mouse_event)
continue;
WindowManager::the().set_hovered_window(menu->menu_window());
auto translated_event = mouse_event.translated(-menu->menu_window()->position());
WindowManager::the().deliver_mouse_event(*menu->menu_window(), translated_event);
WindowManager::the().deliver_mouse_event(*menu->menu_window(), translated_event, true);
break;
}
}