Commit 666bd250 authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Robert Mader
Browse files

wayland: Handle dragging from/dropping to v1 data device users

Interoperation between wl_data_device_manager v1 and v3 got broken
at some point. Ensure that we resort to the "copy" action if either
the drop site or the drag source are from a client that requested v1.

Closes: #965

(cherry picked from commit ffad55c6)
parent 208fd1b0
Pipeline #148203 passed with stages
in 6 minutes and 53 seconds
...@@ -106,6 +106,7 @@ static struct wl_resource * create_and_send_clipboard_offer (MetaWaylandDataDevi ...@@ -106,6 +106,7 @@ static struct wl_resource * create_and_send_clipboard_offer (MetaWaylandDataDevi
struct wl_resource *target); struct wl_resource *target);
static struct wl_resource * create_and_send_primary_offer (MetaWaylandDataDevice *data_device, static struct wl_resource * create_and_send_primary_offer (MetaWaylandDataDevice *data_device,
struct wl_resource *target); struct wl_resource *target);
static struct wl_resource * meta_wayland_data_source_get_resource (MetaWaylandDataSource *source);
static void static void
unbind_resource (struct wl_resource *resource) unbind_resource (struct wl_resource *resource)
...@@ -138,8 +139,20 @@ data_offer_choose_action (MetaWaylandDataOffer *offer) ...@@ -138,8 +139,20 @@ data_offer_choose_action (MetaWaylandDataOffer *offer)
MetaWaylandDataSource *source = offer->source; MetaWaylandDataSource *source = offer->source;
uint32_t actions, user_action, available_actions; uint32_t actions, user_action, available_actions;
if (wl_resource_get_version (offer->resource) <
if (wl_resource_get_version (meta_wayland_data_source_get_resource (source)) <
actions = meta_wayland_data_source_get_actions (source); actions = meta_wayland_data_source_get_actions (source);
user_action = meta_wayland_data_source_get_user_action (source); user_action = meta_wayland_data_source_get_user_action (source);
available_actions = actions & offer->dnd_actions; available_actions = actions & offer->dnd_actions;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment