mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Everywhere: Consolidate double/triple click handling to use click count
This moves normal/double/triple click checking into WebContent, the client only has to send a click count in order to activate a double or triple click in the content. This means that the AppKit UI will no longer fire multiple double clicks when clicking in place more than 3 times. This matches the behavior of other browsers on macOS. We will now also fire the click event regardless of whether a dblclick event will follow, as the spec requires.
This commit is contained in:
committed by
Gregory Bertilson
parent
6f93d03922
commit
a51967311e
Notes:
github-actions[bot]
2026-03-17 09:03:09 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/a51967311eb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8392
@@ -292,7 +292,7 @@ void EventLoop::process_input_events() const
|
||||
[&](MouseEvent const& mouse_event) {
|
||||
switch (mouse_event.type) {
|
||||
case MouseEvent::Type::MouseDown:
|
||||
return page.handle_mousedown(mouse_event.position, mouse_event.screen_position, mouse_event.button, mouse_event.buttons, mouse_event.modifiers);
|
||||
return page.handle_mousedown(mouse_event.position, mouse_event.screen_position, mouse_event.button, mouse_event.buttons, mouse_event.modifiers, mouse_event.click_count);
|
||||
case MouseEvent::Type::MouseUp:
|
||||
return page.handle_mouseup(mouse_event.position, mouse_event.screen_position, mouse_event.button, mouse_event.buttons, mouse_event.modifiers);
|
||||
case MouseEvent::Type::MouseMove:
|
||||
@@ -301,10 +301,6 @@ void EventLoop::process_input_events() const
|
||||
return page.handle_mouseleave();
|
||||
case MouseEvent::Type::MouseWheel:
|
||||
return page.handle_mousewheel(mouse_event.position, mouse_event.screen_position, mouse_event.button, mouse_event.buttons, mouse_event.modifiers, mouse_event.wheel_delta_x, mouse_event.wheel_delta_y);
|
||||
case MouseEvent::Type::DoubleClick:
|
||||
return page.handle_doubleclick(mouse_event.position, mouse_event.screen_position, mouse_event.button, mouse_event.buttons, mouse_event.modifiers);
|
||||
case MouseEvent::Type::TripleClick:
|
||||
return page.handle_tripleclick(mouse_event.position, mouse_event.screen_position, mouse_event.button, mouse_event.buttons, mouse_event.modifiers);
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user