From d3223cc4b446e4ece4e416e481293ab91f9cd74e Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Thu, 22 Apr 2021 21:25:18 -0600 Subject: [PATCH] data-device: cleanup after touch drag This change fixes the "touch-up" operation to clear "data_source" by setting "seat" to NULL. This operation is done in the mouse button release operation, but seems to have been forgotten in the "touch up" case. Forgetting this operation causes weston to send a "premature finish request" error to the client which causes the client to exit. This issue can be reproduced with the "weston-dnd" program by performing a drag-and-drop operation with a touch input device. Once the drag is released, the weston-dnd program will exit with an error. Signed-off-by: Jonathan Marler --- libweston/data-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libweston/data-device.c b/libweston/data-device.c index a69e30f9..fc4e662c 100644 --- a/libweston/data-device.c +++ b/libweston/data-device.c @@ -757,8 +757,10 @@ drag_grab_touch_up(struct weston_touch_grab *grab, if (touch_drag->base.focus_resource) wl_data_device_send_drop(touch_drag->base.focus_resource); - if (touch_drag->base.data_source) + if (touch_drag->base.data_source) { + touch_drag->base.data_source->seat = NULL; wl_list_remove(&touch_drag->base.data_source_listener.link); + } data_device_end_touch_drag_grab(touch_drag); }