mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 21:54:10 +00:00
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.
This commit is contained in:
parent
9efd96be7b
commit
827e0c23c5
@ -47,6 +47,7 @@ struct _MetaWaylandDataSource
|
|||||||
{
|
{
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
struct wl_array mime_types;
|
struct wl_array mime_types;
|
||||||
|
gboolean has_target;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -68,7 +69,10 @@ data_offer_accept (struct wl_client *client,
|
|||||||
* this be a wl_data_device request? */
|
* this be a wl_data_device request? */
|
||||||
|
|
||||||
if (offer->source)
|
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
|
static void
|
||||||
@ -317,7 +321,10 @@ data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (drag_grab->drag_data_source)
|
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;
|
drag_grab->seat->data_device.current_grab = NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user