[gtk/matthiasc/for-master] placessidebar: Fix the bookmark drag icon



commit e18de295c6fbd2914cfb5807fc6f676a8c511431
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 8 14:24:45 2020 -0400

    placessidebar: Fix the bookmark drag icon
    
    Just use the widget; a paintable only works if the
    widget it is based on actually gets drawn, the
    clone we create here wasn't.

 gtk/gtkplacessidebar.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index f72301e60f..106f227789 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -61,7 +61,6 @@
 #include "gtknative.h"
 #include "gtkdragsource.h"
 #include "gtkdragicon.h"
-#include "gtkwidgetpaintable.h"
 #include "gtkstylecontext.h"
 
 /*< private >
@@ -3475,7 +3474,6 @@ on_row_dragged (GtkGestureDrag *gesture,
       GdkDevice *device;
       GtkAllocation allocation;
       GtkWidget *drag_widget;
-      GdkPaintable *paintable;
       GdkDrag *drag;
 
       gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
@@ -3501,17 +3499,11 @@ on_row_dragged (GtkGestureDrag *gesture,
       gtk_widget_hide (sidebar->drag_row);
 
       drag_widget = GTK_WIDGET (gtk_sidebar_row_clone (GTK_SIDEBAR_ROW (sidebar->drag_row)));
-      g_object_ref_sink (drag_widget);
       sidebar->drag_row_height = allocation.height;
       gtk_widget_set_size_request (drag_widget, allocation.width, allocation.height);
-
       gtk_widget_set_opacity (drag_widget, 0.8);
 
-      paintable = gtk_widget_paintable_new (drag_widget);
-      gtk_drag_icon_set_from_paintable (drag, paintable, sidebar->drag_row_x, sidebar->drag_row_y);
-      g_object_unref (paintable);
-
-      g_object_set_data_full (G_OBJECT (drag), "row-widget", drag_widget, (GDestroyNotify)g_object_unref);
+      gtk_drag_icon_set_child (GTK_DRAG_ICON (gtk_drag_icon_get_for_drag (drag)), drag_widget);
 
       g_object_unref (drag);
     }


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