drag: destroy data source on touch_up

This is in case we drop the drag with no focus, we want to destroy the
drag to tell the client the drag was cancelled.
This commit is contained in:
Ilia Bozhinov 2022-08-20 15:49:43 +02:00 committed by Simon Ser
parent bf9452433c
commit 03b465f324

View file

@ -292,6 +292,10 @@ static uint32_t drag_handle_touch_up(struct wlr_seat_touch_grab *grab,
if (drag->focus_client) { if (drag->focus_client) {
drag_drop(drag, time); drag_drop(drag, time);
} else if (drag->source->impl->dnd_finish) {
// This will end the grab and free `drag`
wlr_data_source_destroy(drag->source);
return 0;
} }
drag_destroy(drag); drag_destroy(drag);