summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorDavid Vaughan <david@davidv.xyz>2024-02-03 19:41:43 -0800
committerDudemanguy <random342@airmail.cc>2024-02-26 02:03:21 +0000
commita8a314b829498c55aed393d4bc7f4f7bf9e92362 (patch)
treec220248353f4a8c2f0feb74707bb4eb317653c14 /video/out/wayland_common.c
parent432256e5d2ccee8806023f03aea076f46d9cc9ea (diff)
downloadmpv-a8a314b829498c55aed393d4bc7f4f7bf9e92362.tar.bz2
mpv-a8a314b829498c55aed393d4bc7f4f7bf9e92362.tar.xz
input: add insert-next support for drag-and-drop
This commit adds a DND_INSERT_NEXT action option for drag-and-drop, allows for selecting it through the --drag-and-drop=insert-next option, and adds the necessary plumbing to make that happen when something is dragged onto the player.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 91148f3af1..a36076b708 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -695,8 +695,14 @@ static void data_offer_action(void *data, struct wl_data_offer *wl_data_offer, u
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 char * const dnd_action_names[] = {
+ [DND_REPLACE] = "DND_REPLACE",
+ [DND_APPEND] = "DND_APPEND",
+ [DND_INSERT_NEXT] = "DND_INSERT_NEXT",
+ };
+
+ MP_VERBOSE(wl, "DND action is %s\n", dnd_action_names[wl->dnd_action]);
}
}