diff options
author | MacDue <macdue@dueutil.tech> | 2023-01-03 20:01:12 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-03 21:25:08 +0100 |
commit | c7ab6daf261f527b03a2904e5f41f5951f32381b (patch) | |
tree | 1a9dd127bdd90225f87102513640ec9dcfa4d56f /Userland | |
parent | 25a60f988a8d9770f368dc3e598584fd8c1b9a28 (diff) | |
download | serenity-c7ab6daf261f527b03a2904e5f41f5951f32381b.zip |
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
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGUI/Window.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 44a43ecf44..3c6d7c369b 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -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) |