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>
This commit is contained in:
parent
dddf9e67b7
commit
d46bb01b62
@ -743,15 +743,18 @@ weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client)
|
|||||||
{
|
{
|
||||||
struct wl_resource *data_device, *offer;
|
struct wl_resource *data_device, *offer;
|
||||||
|
|
||||||
data_device = wl_resource_find_for_client(&seat->drag_resource_list,
|
wl_resource_for_each(data_device, &seat->drag_resource_list) {
|
||||||
client);
|
if (wl_resource_get_client(data_device) != client)
|
||||||
if (data_device && seat->selection_data_source) {
|
continue;
|
||||||
|
|
||||||
|
if (seat->selection_data_source) {
|
||||||
offer = weston_data_source_send_offer(seat->selection_data_source,
|
offer = weston_data_source_send_offer(seat->selection_data_source,
|
||||||
data_device);
|
data_device);
|
||||||
wl_data_device_send_selection(data_device, offer);
|
wl_data_device_send_selection(data_device, offer);
|
||||||
} else if (data_device) {
|
} else {
|
||||||
wl_data_device_send_selection(data_device, NULL);
|
wl_data_device_send_selection(data_device, NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
|
Loading…
Reference in New Issue
Block a user