wayland: Clean up drags
authorMatthias Clasen <mclasen@redhat.com>
Sat, 4 Jan 2020 05:12:57 +0000 (00:12 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 4 Jan 2020 14:36:38 +0000 (09:36 -0500)
We need to set the drag to NULL in gdk_wayland_drag_drop_done,
otherwise, all future drags will be considered local after the
first local one. Worse, they will also provide the wrong data.

gdk/wayland/gdkdrag-wayland.c

index cf7e48a251ae6cd4485459766576edbde898b1cb..9226fae10ae1373afaa3f9ded39d17e1b3efb2c2 100644 (file)
@@ -173,7 +173,7 @@ gdk_wayland_drag_drop_done (GdkDrag  *drag,
   GdkWaylandDrag *drag_wayland = GDK_WAYLAND_DRAG (drag);
   GdkDevice *device = gdk_drag_get_device (drag);
 
-  gdk_wayland_seat_set_drag (gdk_device_get_seat (device), drag);
+  gdk_wayland_seat_set_drag (gdk_device_get_seat (device), NULL);
 
   if (success)
     {
@@ -402,6 +402,7 @@ _gdk_wayland_surface_drag_begin (GdkSurface         *surface,
                                   gdk_to_wl_actions (actions));
     }
 
+g_print ("drag begin\n");
   gdk_wayland_seat_set_drag (seat, drag);
 
   wl_data_device_start_drag (gdk_wayland_device_get_data_device (device),