diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp index 1424c588928..6c4e99aca45 100644 --- a/Libraries/LibGUI/Window.cpp +++ b/Libraries/LibGUI/Window.cpp @@ -695,9 +695,9 @@ void Window::did_remove_widget(Badge, const Widget& widget) m_focused_widget = nullptr; if (m_hovered_widget == &widget) m_hovered_widget = nullptr; - if (m_global_cursor_tracking_widget) + if (m_global_cursor_tracking_widget == &widget) m_global_cursor_tracking_widget = nullptr; - if (m_automatic_cursor_tracking_widget) + if (m_automatic_cursor_tracking_widget == &widget) m_automatic_cursor_tracking_widget = nullptr; }