From 43bd057754d9c1849135f8dd74e21007b2585ca5 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 29 Feb 2016 16:44:39 +0100 Subject: [PATCH] wayland: Ensure harder we're dealing with DnD offers/sources In destroy_data_offer() there is code to ensure compatibility when dragging from a v3 wl_data_device to a v2 one, it's however not checking correctly that this is the DnD drag source. The other path should be used otherwise. https://bugzilla.gnome.org/show_bug.cgi?id=762878 --- src/wayland/meta-wayland-data-device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c index 5cdb5004a..614b68e85 100644 --- a/src/wayland/meta-wayland-data-device.c +++ b/src/wayland/meta-wayland-data-device.c @@ -492,12 +492,16 @@ static void destroy_data_offer (struct wl_resource *resource) { MetaWaylandDataOffer *offer = wl_resource_get_user_data (resource); + MetaWaylandSeat *seat; if (offer->source) { + seat = meta_wayland_data_source_get_seat (offer->source); + if (offer == meta_wayland_data_source_get_current_offer (offer->source)) { - if (wl_resource_get_version (offer->resource) < + if (seat && seat->data_device.dnd_data_source == offer->source && + wl_resource_get_version (offer->resource) < WL_DATA_OFFER_ACTION_SINCE_VERSION) meta_wayland_data_source_notify_finish (offer->source); else