From 5f364f5dc1067ee720b1e333a06ca2184bfe5252 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 9 Jan 2021 12:01:23 +0100 Subject: [PATCH] LibGUI: Clear the application's drag-hovered widget on drop event When we drop something on any window, there's no longer an ongoing drag so let's forget the drag-hovered widget. --- Libraries/LibGUI/Window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp index ac4aa36001..353997a224 100644 --- a/Libraries/LibGUI/Window.cpp +++ b/Libraries/LibGUI/Window.cpp @@ -280,7 +280,9 @@ void Window::handle_drop_event(DropEvent& event) auto result = m_main_widget->hit_test(event.position()); auto local_event = make(result.local_position, event.text(), event.mime_data()); ASSERT(result.widget); - return result.widget->dispatch_event(*local_event, this); + result.widget->dispatch_event(*local_event, this); + + Application::the()->set_drag_hovered_widget({}, nullptr); } void Window::handle_mouse_event(MouseEvent& event)