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.
This commit is contained in:
Dudemanguy 2023-05-20 16:11:13 -05:00
parent 1c82d6ae7a
commit 2f8d9322fd
1 changed files with 6 additions and 4 deletions

View File

@ -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 = {