mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 19:19:44 +03:00
LibGUI: Stop duplicating mouse events of cursor tracking widget
Previously we didn't always return when there was an automatic cursor tracking widget. This meant for certain events e.g. a MouseUp over the tracking widget, the event would be fired twice on the same widget (once on `m_automatic_cursor_tracking_widget` then again on `result.widget` outside the if). Fixes #16737
This commit is contained in:
parent
25a60f988a
commit
c7ab6daf26
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/c7ab6daf26 Pull-request: https://github.com/SerenityOS/serenity/pull/16799 Issue: https://github.com/SerenityOS/serenity/issues/16737
@ -385,8 +385,8 @@ void Window::handle_mouse_event(MouseEvent& event)
|
||||
} else {
|
||||
auto is_hovered = m_automatic_cursor_tracking_widget.ptr() == result.widget.ptr();
|
||||
set_hovered_widget(is_hovered ? m_automatic_cursor_tracking_widget.ptr() : nullptr);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
set_hovered_widget(result.widget);
|
||||
if (event.buttons() != 0 && !m_automatic_cursor_tracking_widget)
|
||||
|
Loading…
Reference in New Issue
Block a user