mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +00:00
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:
parent
69df3cfae7
commit
be48a89b35
3 changed files with 23 additions and 22 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue