[mutter/gnome-3-34] wayland: Do not check current offer on DnD button release



commit 5ae317e0040cf6c3b2efd2f024a59f05b44e3a4b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jan 17 19:36:54 2020 +0100

    wayland: Do not check current offer on DnD button release
    
    This check was added on commit 48639ac5 as a means to disregard
    DnD drops where the offer would disappear beforehand. However since
    that commit was all about wl_data_device_manager version < 3,
    forgetting about the selected mimetype seems a behavior more inline
    with those versions.
    
    Since no current drop is something expected on X11 drop sites, fixes
    DnD over those, while keeping the original bug fixed.
    
    Found by Robert Mader (https://gitlab.gnome.org/GNOME/mutter/issues/974#note_688144)
    
    https://gitlab.gnome.org/GNOME/mutter/issues/974
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1005
    
    (cherry picked from commit 30bf588a38c326897efb8637aad5dfeb0cafe5c9)

 src/wayland/meta-wayland-data-device.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 08940c94b..dee474eef 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -569,9 +569,14 @@ destroy_data_offer (struct wl_resource *resource)
           if (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);
+            {
+              meta_wayland_data_source_notify_finish (offer->source);
+            }
           else
-            meta_wayland_data_source_set_current_offer (offer->source, NULL);
+            {
+              meta_wayland_data_source_set_current_offer (offer->source, NULL);
+              meta_wayland_data_source_set_has_target (offer->source, FALSE);
+            }
         }
 
       g_object_remove_weak_pointer (G_OBJECT (offer->source),
@@ -1031,7 +1036,6 @@ drag_grab_button (MetaWaylandPointerGrab *grab,
       gboolean success;
 
       if (drag_grab->drag_focus && source &&
-          meta_wayland_data_source_get_current_offer (source) &&
           meta_wayland_data_source_has_target (source) &&
           meta_wayland_data_source_get_current_action (source))
         {


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