data-device: Verify that the client has an implicit grab when starting a drag

Make sure that the implicit is valid and still in effect as we start
the drag.  Fixes a long standing FIXME.
This commit is contained in:
Kristian Høgsberg 2013-05-08 15:53:42 -04:00
parent 5a9fb35c89
commit dba25868bc
1 changed files with 4 additions and 2 deletions

View File

@ -351,8 +351,10 @@ data_device_start_drag(struct wl_client *client, struct wl_resource *resource,
struct weston_drag *drag = resource->data;
struct weston_surface *icon = NULL;
/* FIXME: Check that client has implicit grab on the origin
* surface that matches the given time. */
if (seat->pointer->button_count == 0 ||
seat->pointer->grab_serial != serial ||
seat->pointer->focus != origin_resource->data)
return;
/* FIXME: Check that the data source type array isn't empty. */