diff options
Diffstat (limited to 'Userland/Libraries/LibGUI/Window.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/Window.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 72e6b9a630..1df3522d3f 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -347,13 +347,6 @@ void Window::handle_drop_event(DropEvent& event) void Window::handle_mouse_event(MouseEvent& event) { - if (m_global_cursor_tracking_widget) { - auto window_relative_rect = m_global_cursor_tracking_widget->window_relative_rect(); - Gfx::IntPoint local_point { event.x() - window_relative_rect.x(), event.y() - window_relative_rect.y() }; - auto local_event = MouseEvent((Event::Type)event.type(), local_point, event.buttons(), event.button(), event.modifiers(), event.wheel_delta()); - m_global_cursor_tracking_widget->dispatch_event(local_event, this); - return; - } if (m_automatic_cursor_tracking_widget) { auto window_relative_rect = m_automatic_cursor_tracking_widget->window_relative_rect(); Gfx::IntPoint local_point { event.x() - window_relative_rect.x(), event.y() - window_relative_rect.y() }; @@ -371,8 +364,7 @@ void Window::handle_mouse_event(MouseEvent& event) set_hovered_widget(result.widget); if (event.buttons() != 0 && !m_automatic_cursor_tracking_widget) m_automatic_cursor_tracking_widget = *result.widget; - if (result.widget != m_global_cursor_tracking_widget.ptr()) - result.widget->dispatch_event(local_event, this); + result.widget->dispatch_event(local_event, this); if (!m_pending_paint_event_rects.is_empty()) { MultiPaintEvent paint_event(move(m_pending_paint_event_rects), size()); @@ -755,13 +747,6 @@ void Window::set_focused_widget(Widget* widget, FocusSource source) } } -void Window::set_global_cursor_tracking_widget(Widget* widget) -{ - if (widget == m_global_cursor_tracking_widget) - return; - m_global_cursor_tracking_widget = widget; -} - void Window::set_automatic_cursor_tracking_widget(Widget* widget) { if (widget == m_automatic_cursor_tracking_widget) @@ -1138,8 +1123,6 @@ void Window::did_remove_widget(Badge<Widget>, Widget& widget) m_focused_widget = nullptr; if (m_hovered_widget == &widget) m_hovered_widget = nullptr; - if (m_global_cursor_tracking_widget == &widget) - m_global_cursor_tracking_widget = nullptr; if (m_automatic_cursor_tracking_widget == &widget) m_automatic_cursor_tracking_widget = nullptr; } |