From 2f8d9322fd8f1bcc4ec27b917f042253e2d6b62d Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 20 May 2023 16:11:13 -0500 Subject: [PATCH] wayland: avoid misleading log messages on drag/drop In data_offer_actions, it's possible to get the WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE action which would set wl->dnd_action to DND_APPEND (did nothing in practice) but also log a message which is confusing and misleading. Instead, just ignore and don't do anything when we get this case. --- video/out/wayland_common.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 49e0eb0fa4..48f30c9c6f 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -534,10 +534,12 @@ static void data_offer_source_actions(void *data, struct wl_data_offer *offer, u static void data_offer_action(void *data, struct wl_data_offer *wl_data_offer, uint32_t dnd_action) { struct vo_wayland_state *wl = data; - wl->dnd_action = dnd_action & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY ? - DND_REPLACE : DND_APPEND; - MP_VERBOSE(wl, "DND action is %s\n", - wl->dnd_action == DND_REPLACE ? "DND_REPLACE" : "DND_APPEND"); + if (dnd_action) { + wl->dnd_action = dnd_action & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY ? + DND_REPLACE : DND_APPEND; + MP_VERBOSE(wl, "DND action is %s\n", + wl->dnd_action == DND_REPLACE ? "DND_REPLACE" : "DND_APPEND"); + } } static const struct wl_data_offer_listener data_offer_listener = {