summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-05-20 16:11:13 -0500
committerDudemanguy <random342@airmail.cc>2023-06-12 20:50:08 +0000
commit2f8d9322fd8f1bcc4ec27b917f042253e2d6b62d (patch)
treeb2ba7c3bfcabe357964a26493c35ec209317a551 /video
parent1c82d6ae7a31f8ef3a3f5120bd50480c312039cf (diff)
downloadmpv-2f8d9322fd8f1bcc4ec27b917f042253e2d6b62d.tar.bz2
mpv-2f8d9322fd8f1bcc4ec27b917f042253e2d6b62d.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/wayland_common.c10
1 files 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 = {