summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-05-08 15:53:42 -0400
committerKristian Høgsberg <krh@bitplanet.net>2013-05-08 15:58:49 -0400
commitdba25868bc3ce2507396e7b9cce5abf9a1a01548 (patch)
treee2364b980631590de64eaebe8725de1808127e98
parent5a9fb35c89549ba38a43187c9455bd5d6b6ca94b (diff)
downloadweston-dba25868bc3ce2507396e7b9cce5abf9a1a01548.tar.gz
weston-dba25868bc3ce2507396e7b9cce5abf9a1a01548.tar.bz2
weston-dba25868bc3ce2507396e7b9cce5abf9a1a01548.zip
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.
-rw-r--r--src/data-device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/data-device.c b/src/data-device.c
index 93c923c9..e9c7ed76 100644
--- a/src/data-device.c
+++ b/src/data-device.c
@@ -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. */