[gtk/wip/carlosg/x11-dnd: 31/32] gdk/x11: Ensure to sync type list after sending XdndEnter



commit 34428818f2241cc6f80cf9f578f2ff66c29610e3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jan 14 00:02:12 2020 +0100

    gdk/x11: Ensure to sync type list after sending XdndEnter
    
    Otherwise we are not ensured the GdkDrop is up-to-date, might even
    be a stale one from an older DnD opertion.

 gdk/x11/gdkdrag-x11.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c
index 55e157b52a..4bf609a1de 100644
--- a/gdk/x11/gdkdrag-x11.c
+++ b/gdk/x11/gdkdrag-x11.c
@@ -1506,23 +1506,6 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
         }
     }
 
-  /* When we have a Xdnd target, make sure our XdndActionList
-   * matches the current actions;
-   */
-  if (protocol == GDK_DRAG_PROTO_XDND && drag_x11->xdnd_actions != gdk_drag_get_actions (drag))
-    {
-      if (proxy_xid)
-        {
-          GdkDisplay *display = gdk_drag_get_display (drag);
-          GdkDrop *drop = GDK_X11_DISPLAY (display)->current_drop;
-
-          if (drop && GDK_SURFACE_XID (gdk_drop_get_surface (drop)) == proxy_xid)
-            gdk_x11_drop_read_actions (drop);
-          else
-            xdnd_set_actions (drag_x11);
-        }
-    }
-
   if (drag_x11->proxy_xid != proxy_xid)
     {
       /* Send a leave to the last destination */
@@ -1562,6 +1545,23 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
       drag_x11->current_action = gdk_drag_get_selected_action (drag);
     }
 
+  /* When we have a Xdnd target, make sure our XdndActionList
+   * matches the current actions;
+   */
+  if (protocol == GDK_DRAG_PROTO_XDND && drag_x11->xdnd_actions != gdk_drag_get_actions (drag))
+    {
+      if (proxy_xid)
+        {
+          GdkDisplay *display = gdk_drag_get_display (drag);
+          GdkDrop *drop = GDK_X11_DISPLAY (display)->current_drop;
+
+          if (drop && GDK_SURFACE_XID (gdk_drop_get_surface (drop)) == proxy_xid)
+            gdk_x11_drop_read_actions (drop);
+          else
+            xdnd_set_actions (drag_x11);
+        }
+    }
+
   /* Send a drag-motion event */
 
   drag_x11->last_x = x_root;


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