diff options
author | David Vaughan <david@davidv.xyz> | 2024-02-03 19:41:43 -0800 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-02-26 02:03:21 +0000 |
commit | a8a314b829498c55aed393d4bc7f4f7bf9e92362 (patch) | |
tree | c220248353f4a8c2f0feb74707bb4eb317653c14 /video/out/wayland_common.c | |
parent | 432256e5d2ccee8806023f03aea076f46d9cc9ea (diff) | |
download | mpv-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.c | 10 |
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]); } } |