summaryrefslogtreecommitdiff
path: root/src/data-device.c
diff options
context:
space:
mode:
authorGiulio Camuffo <giuliocamuffo@gmail.com>2015-05-01 12:59:36 +0300
committerDaniel Stone <daniels@collabora.com>2015-05-01 13:02:33 +0100
commitd46bb01b628a2805287bc9947739adeaf17f0a60 (patch)
tree074b578010553420b76adfd854db12be0293891c /src/data-device.c
parentdddf9e67b732f6fcee2e42423838bd799b31e92e (diff)
downloadweston-d46bb01b628a2805287bc9947739adeaf17f0a60.tar.gz
data-device: send the selection to all the wl_data_device resources of a client
As we do for the input interfaces such as wl_pointer, we must send the selection event to all the wl_data_device resources the client created for a specified seat. Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'src/data-device.c')
-rw-r--r--src/data-device.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/data-device.c b/src/data-device.c
index 56c25077..3e7baf90 100644
--- a/src/data-device.c
+++ b/src/data-device.c
@@ -743,14 +743,17 @@ weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client)
{
struct wl_resource *data_device, *offer;
- data_device = wl_resource_find_for_client(&seat->drag_resource_list,
- client);
- if (data_device && seat->selection_data_source) {
- offer = weston_data_source_send_offer(seat->selection_data_source,
- data_device);
- wl_data_device_send_selection(data_device, offer);
- } else if (data_device) {
- wl_data_device_send_selection(data_device, NULL);
+ wl_resource_for_each(data_device, &seat->drag_resource_list) {
+ if (wl_resource_get_client(data_device) != client)
+ continue;
+
+ if (seat->selection_data_source) {
+ offer = weston_data_source_send_offer(seat->selection_data_source,
+ data_device);
+ wl_data_device_send_selection(data_device, offer);
+ } else {
+ wl_data_device_send_selection(data_device, NULL);
+ }
}
}