aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-04-19 20:35:15 +0300
committerDrew DeVault <sir@cmpwn.com>2019-04-19 13:24:41 -0600
commit4207f05030a2fcf1903248730ffab6d14f627fbe (patch)
tree32fbe339dc888d8251027fc07bb1894712506a68
parentd6615e0e844265d60e4624afa12b2bba1f967e57 (diff)
data-device: ignore accept for selection offers
It doesn't make sense for clients to send "accept" requests to offers that aren't drag-and-drop. I discussed with Daniel Stone to make it a protocol error [1] but too many clients send it (e.g. GTK+). Let's just log it for now. [1]: https://gitlab.freedesktop.org/wayland/wayland/merge_requests/11#note_149710
-rw-r--r--types/data_device/wlr_data_offer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/types/data_device/wlr_data_offer.c b/types/data_device/wlr_data_offer.c
index 8246a9a2..c0c008cb 100644
--- a/types/data_device/wlr_data_offer.c
+++ b/types/data_device/wlr_data_offer.c
@@ -82,6 +82,12 @@ static void data_offer_handle_accept(struct wl_client *client,
return;
}
+ if (offer->type != WLR_DATA_OFFER_DRAG) {
+ wlr_log(WLR_DEBUG, "Ignoring wl_data_offer.accept request on a "
+ "non-drag-and-drop offer");
+ return;
+ }
+
wlr_data_source_accept(offer->source, serial, mime_type);
}