From 07e1bedb088b8c29ba1154cc052468acb2fe1872 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 18 Feb 2019 16:36:23 +0100 Subject: data-device: make old offers inert before sending selection Fixes https://github.com/swaywm/wlroots/issues/1383 --- types/data_device/wlr_data_device.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c index feddfa2d..36a9d1b8 100644 --- a/types/data_device/wlr_data_device.c +++ b/types/data_device/wlr_data_device.c @@ -126,6 +126,13 @@ void seat_client_send_selection(struct wlr_seat_client *seat_client) { source->accepted = false; } + // Make all current offers inert + struct wlr_data_offer *offer, *tmp; + wl_list_for_each_safe(offer, tmp, + &seat_client->seat->selection_offers, link) { + data_offer_destroy(offer); + } + struct wl_resource *device_resource; wl_resource_for_each(device_resource, &seat_client->data_devices) { device_resource_send_selection(device_resource); -- cgit v1.2.3