From 2e4da6fbf69eb9edafdd74923fc155d16fde2133 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 20 Jun 2022 19:29:57 +0200 Subject: selection: ignore drag-and-drops with unsupported mime-types Specifically, make sure we do *not* call wl_data_offer_receive() with a NULL mime-type, as this causes libwayland to error out, which in turn causes foot to exit. Closes #1092 --- selection.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'selection.c') diff --git a/selection.c b/selection.c index 37dd2c8d..20e2d8d8 100644 --- a/selection.c +++ b/selection.c @@ -2392,6 +2392,12 @@ drop(void *data, struct wl_data_device *wl_data_device) struct wl_clipboard *clipboard = &seat->clipboard; + if (clipboard->mime_type == DATA_OFFER_MIME_UNSET) { + LOG_WARN("compositor called data_device::drop() " + "even though we rejected the drag-and-drop"); + return; + } + struct dnd_context *ctx = xmalloc(sizeof(*ctx)); *ctx = (struct dnd_context){ .term = term, -- cgit v1.3