[mutter] wayland: Ensure harder we're dealing with DnD offers/sources



commit 43bd057754d9c1849135f8dd74e21007b2585ca5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Feb 29 16:44:39 2016 +0100

    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 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 5cdb500..614b68e 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]