From dba25868bc3ce2507396e7b9cce5abf9a1a01548 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 8 May 2013 15:53:42 -0400 Subject: [PATCH] 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. --- src/data-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data-device.c b/src/data-device.c index 93c923c..e9c7ed7 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. */ -- 2.7.4