[gtk/wip/carlosg/x11-dnd: 1/5] gdk/x11: Serialize gtype content formats before sending Xdnd enter



commit 682068f8879654da436aaf518ffe5be7edcdddbd
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jan 13 20:07:27 2020 +0100

    gdk/x11: Serialize gtype content formats before sending Xdnd enter
    
    This ensures GType handlers get serialized to mimetypes at the time
    the drag dest inspects the XdndTypeList property.

 gdk/x11/gdkdrag-x11.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c
index 724099dab0..55e157b52a 100644
--- a/gdk/x11/gdkdrag-x11.c
+++ b/gdk/x11/gdkdrag-x11.c
@@ -1061,6 +1061,7 @@ xdnd_send_enter (GdkX11Drag *drag_x11)
 {
   GdkDrag *drag = GDK_DRAG (drag_x11);
   GdkDisplay *display = gdk_drag_get_display (drag);
+  GdkContentFormats *formats;
   const char * const *atoms;
   gsize i, n_atoms;
   XEvent xev;
@@ -1080,7 +1081,10 @@ xdnd_send_enter (GdkX11Drag *drag_x11)
   GDK_DISPLAY_NOTE (display, DND,
            g_message ("Sending enter source window %#lx XDND protocol version %d\n",
                       GDK_SURFACE_XID (drag_x11->ipc_surface), drag_x11->version));
-  atoms = gdk_content_formats_get_mime_types (gdk_drag_get_formats (drag), &n_atoms);
+  formats = gdk_content_formats_ref (gdk_drag_get_formats (drag));
+  formats = gdk_content_formats_union_serialize_mime_types (formats);
+
+  atoms = gdk_content_formats_get_mime_types (formats, &n_atoms);
 
   if (n_atoms > 3)
     {


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