[gtk/wip/jimmac/icon-dropshadows: 5/13] Modify Quartz gtk_drag_begin_internal to match 4172138.



commit 94f620057bca220944f3bc49b2815a1d98af5dce
Author: John Ralls <jralls ceridwen us>
Date:   Sat Oct 20 12:26:13 2018 -0700

    Modify Quartz gtk_drag_begin_internal to match 4172138.

 gtk/gtkdnd-quartz.c | 30 ++++++------------------------
 1 file changed, 6 insertions(+), 24 deletions(-)
---
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index d92933a0e8..f4ee86982e 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -1128,7 +1128,7 @@ gtk_drag_begin_idle (gpointer arg)
 
 GdkDragContext *
 gtk_drag_begin_internal (GtkWidget         *widget,
-                        GtkImageDefinition *icon,
+                        gboolean          *out_needs_icon,
                         GtkTargetList     *target_list,
                         GdkDragAction      actions,
                         gint               button,
@@ -1221,29 +1221,11 @@ gtk_drag_begin_internal (GtkWidget         *widget,
    * application may have set one in ::drag_begin, or it may
    * not have set one.
    */
-  if (!info->icon_surface && icon)
-    {
-      switch (gtk_image_definition_get_storage_type (icon))
-        {
-          case GTK_IMAGE_PIXBUF:
-              gtk_drag_set_icon_pixbuf (context,
-                                        gtk_image_definition_get_pixbuf (icon),
-                                        -2, -2);
-              break;
-          case GTK_IMAGE_STOCK:
-              gtk_drag_set_icon_stock (context,
-                                       gtk_image_definition_get_stock (icon),
-                                       -2, -2);
-              break;
-          case GTK_IMAGE_ICON_NAME:
-              gtk_drag_set_icon_name (context,
-                                      gtk_image_definition_get_icon_name (icon),
-                                      -2, -2);
-              break;
-          default:
-              break;
-        }
-    }
+  if (info->icon_surface == NULL && out_needs_icon == NULL)
+    gtk_drag_set_icon_default (context);
+
+  if (out_needs_icon != NULL)
+    *out_needs_icon = (info->icon_surface == NULL);
 
   /* no image def or no supported type -> set the default */
   if (!info->icon_surface)


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