aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-02-18 15:27:09 -0500
committerGitHub <noreply@github.com>2019-02-18 15:27:09 -0500
commitb455df3b9172286f7af137ffdc7b0b5735e9ddb3 (patch)
tree9bf1d38b02056fff1b41fc8fb9647ec7904459ba
parent7aa445779cb5c877216aac362af1b61a836e3467 (diff)
parent07e1bedb088b8c29ba1154cc052468acb2fe1872 (diff)
Merge pull request #1557 from emersion/inert-offers
data-device: make old offers inert before sending selection
-rw-r--r--types/data_device/wlr_data_device.c7
1 files changed, 7 insertions, 0 deletions
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);