libweston: explicitly cancel start_drag if no matching input device is found

Otherwise, the client will assume that dragging is in progress and remains in
that state forever.
This can happen when weston processes the mouse up event just before the
start_drag() arrives.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
dev
Michael Olbrich 5 years ago committed by Daniel Stone
parent 4fb095eca1
commit 78c94d0719
  1. 10
      libweston/data-device.c

@ -1057,13 +1057,17 @@ data_device_start_drag(struct wl_client *client, struct wl_resource *resource,
touch->focus && touch->focus &&
touch->focus->surface == origin; touch->focus->surface == origin;
if (!is_pointer_grab && !is_touch_grab)
return;
/* FIXME: Check that the data source type array isn't empty. */ /* FIXME: Check that the data source type array isn't empty. */
if (source_resource) if (source_resource)
source = wl_resource_get_user_data(source_resource); source = wl_resource_get_user_data(source_resource);
if (!is_pointer_grab && !is_touch_grab) {
if (source)
wl_data_source_send_cancelled(source->resource);
return;
}
if (icon_resource) if (icon_resource)
icon = wl_resource_get_user_data(icon_resource); icon = wl_resource_get_user_data(icon_resource);

Loading…
Cancel
Save