[mutter/wip/carlosg/xwayland-dnd-finish: 5/6] wayland: Manually detach source/offer on failure paths




commit 0f9dc84d3b1a6d80e8ec9389804f5212168d3b78
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Feb 8 20:22:35 2021 +0100

    wayland: Manually detach source/offer on failure paths
    
    Adapt more paths to manual detaching of source/offer. This is still
    done automatically when the grab is finished.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1720>

 src/wayland/meta-wayland-data-device.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index b5f9a0c37f..db77f11ca6 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -501,6 +501,7 @@ keyboard_drag_grab_key (MetaWaylandKeyboardGrab *grab,
 
       drag_grab = wl_container_of (grab, drag_grab, keyboard_grab);
       meta_wayland_data_source_cancel (drag_grab->drag_data_source);
+      meta_wayland_data_source_set_current_offer (drag_grab->drag_data_source, NULL);
       meta_dnd_actor_drag_finish (META_DND_ACTOR (drag_grab->feedback_actor), FALSE);
       drag_grab->feedback_actor = NULL;
       data_device_end_drag_grab (drag_grab);
@@ -547,6 +548,7 @@ destroy_data_device_origin (struct wl_listener *listener, void *data)
   drag_grab->drag_origin = NULL;
   meta_wayland_data_device_set_dnd_source (&drag_grab->seat->data_device, NULL);
   unset_selection_source (&drag_grab->seat->data_device, META_SELECTION_DND);
+  meta_wayland_data_source_set_current_offer (drag_grab->drag_data_source, NULL);
   data_device_end_drag_grab (drag_grab);
 }
 


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