selection: reject dnd offers with unsupported mime-types

We were already doing this, implicitly, *if* the offer was for the
main grid.

This patch makes it more clear that we do not accept the offer.
This commit is contained in:
Daniel Eklöf 2022-06-20 20:57:26 +02:00
parent 0d22e9fa01
commit 6d4d4502e9
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -2322,6 +2322,9 @@ enter(void *data, struct wl_data_device *wl_data_device, uint32_t serial,
xassert(offer == seat->clipboard.data_offer);
if (seat->clipboard.mime_type == DATA_OFFER_MIME_UNSET)
goto reject_offer;
/* Remember _which_ terminal the current DnD offer is targeting */
xassert(seat->clipboard.window == NULL);
tll_foreach(wayl->terms, it) {
@ -2340,6 +2343,7 @@ enter(void *data, struct wl_data_device *wl_data_device, uint32_t serial,
}
}
reject_offer:
/* Either terminal is already busy sending paste data, or mouse
* pointer isnt over the grid */
seat->clipboard.window = NULL;