summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-09-30 17:09:11 +0200
committerCarlos Garnacho <carlosg@gnome.org>2014-10-06 17:11:18 +0200
commitfefb19ed0a92a10c125bc09fc478d708e143e60b (patch)
tree1da542d4dc47db328d94d9585915eed33721da8b
parentb06c4c0c2bb795aa8b4c5ce70f9a306bfa780d24 (diff)
downloadmutter-fefb19ed0a92a10c125bc09fc478d708e143e60b.tar.gz
wayland: Store whether the wl_data_source has a target selected
It will be useful to check whether DnD is going to fail or not.
-rw-r--r--src/wayland/meta-wayland-data-device.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 94e5665a6..6d6f33e5c 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -46,6 +46,7 @@ struct _MetaWaylandDataSource
{
struct wl_resource *resource;
struct wl_array mime_types;
+ gboolean has_target;
};
static void
@@ -67,7 +68,10 @@ data_offer_accept (struct wl_client *client,
* this be a wl_data_device request? */
if (offer->source)
- wl_data_source_send_target (offer->source->resource, mime_type);
+ {
+ wl_data_source_send_target (offer->source->resource, mime_type);
+ offer->source->has_target = mime_type != NULL;
+ }
}
static void
@@ -282,7 +286,10 @@ data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab)
}
if (drag_grab->drag_data_source)
- wl_list_remove (&drag_grab->drag_data_source_listener.link);
+ {
+ drag_grab->drag_data_source->has_target = FALSE;
+ wl_list_remove (&drag_grab->drag_data_source_listener.link);
+ }
drag_grab->seat->data_device.current_grab = NULL;