[mutter] MetaWaylandDataDevice: Propagate the unsetting of a selection
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] MetaWaylandDataDevice: Propagate the unsetting of a selection
- Date: Thu, 18 Jun 2015 03:28:29 +0000 (UTC)
commit bb4dcd62ec2dea2b42aaee52698ad21067fca813
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu May 28 10:20:02 2015 +0800
MetaWaylandDataDevice: Propagate the unsetting of a selection
If a client unsets a selection (calls set_selection with the offer
NULL), this should cause the compositor not to continue sending the
previously set offer.
https://bugzilla.gnome.org/show_bug.cgi?id=750007
src/wayland/meta-wayland-data-device.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 1cbb83f..6bcf0e1 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -676,9 +676,9 @@ meta_wayland_data_device_set_selection (MetaWaylandDataDevice *data_device,
data_device->selection_data_source_listener.notify = destroy_selection_data_source;
wl_resource_add_destroy_listener (source->resource, &data_device->selection_data_source_listener);
}
-
- wl_signal_emit (&data_device->selection_ownership_signal, source);
}
+
+ wl_signal_emit (&data_device->selection_ownership_signal, source);
}
static void
@@ -690,10 +690,10 @@ data_device_set_selection (struct wl_client *client,
MetaWaylandDataDevice *data_device = wl_resource_get_user_data (resource);
MetaWaylandDataSource *source;
- if (!source_resource)
- return;
-
- source = wl_resource_get_user_data (source_resource);
+ if (source_resource)
+ source = wl_resource_get_user_data (source_resource);
+ else
+ source = NULL;
/* FIXME: Store serial and check against incoming serial here. */
meta_wayland_data_device_set_selection (data_device, source, serial);
@@ -801,6 +801,8 @@ meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_device)
offer = meta_wayland_data_source_send_offer (source, data_device_resource);
wl_data_device_send_selection (data_device_resource, offer);
}
+ else
+ wl_data_device_send_selection (data_device_resource, NULL);
}
gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]