1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

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.
This commit is contained in:
Andreas Kling 2021-01-09 12:01:23 +01:00
parent 9e60fc5006
commit 5f364f5dc1

View file

@ -280,7 +280,9 @@ void Window::handle_drop_event(DropEvent& event)
auto result = m_main_widget->hit_test(event.position());
auto local_event = make<DropEvent>(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)