data-device: Start a cleanup
This commit is contained in:
parent
9b5d6cc008
commit
581335fbea
@ -48,6 +48,12 @@ struct _MetaWaylandDataSource
|
||||
struct wl_array mime_types;
|
||||
};
|
||||
|
||||
static void
|
||||
unbind_resource (struct wl_resource *resource)
|
||||
{
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
static void
|
||||
data_offer_accept (struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
@ -483,25 +489,18 @@ create_data_source (struct wl_client *client,
|
||||
wl_array_init (&source->mime_types);
|
||||
}
|
||||
|
||||
static void
|
||||
unbind_data_device (struct wl_resource *resource)
|
||||
{
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
static void
|
||||
get_data_device (struct wl_client *client,
|
||||
struct wl_resource *manager_resource,
|
||||
guint32 id, struct wl_resource *seat_resource)
|
||||
{
|
||||
MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
|
||||
struct wl_resource *resource;
|
||||
struct wl_resource *cr;
|
||||
|
||||
resource = wl_resource_create (client, &wl_data_device_interface,
|
||||
MIN (META_WL_DATA_DEVICE_VERSION,
|
||||
wl_resource_get_version (manager_resource)), id);
|
||||
wl_resource_set_implementation (resource, &data_device_interface, seat, unbind_data_device);
|
||||
wl_list_insert (&seat->data_device_resource_list, wl_resource_get_link (resource));
|
||||
cr = wl_resource_create (client, &wl_data_device_interface,
|
||||
MIN (META_WL_DATA_DEVICE_VERSION, wl_resource_get_version (manager_resource)), id);
|
||||
wl_resource_set_implementation (cr, &data_device_interface, seat, unbind_resource);
|
||||
wl_list_insert (&seat->data_device_resource_list, wl_resource_get_link (cr));
|
||||
}
|
||||
|
||||
static const struct wl_data_device_manager_interface manager_interface = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user