[mutter/wip/carlosg/selection-bugfixes: 33/33] wayland: Do not check current offer on DnD button release



commit 47fc7bd92719f85b3f7caa2b5ea067578965d556
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

 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 915744bae..cd11d618e 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -580,9 +580,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),
@@ -1040,7 +1045,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]