Skip to content

Commit e28ff9c

Browse files
cosimoclukefromdc
authored andcommitted
list-view: use the cairo surface as a drag icon
As we now store surfaces in the GtkListStore, we have to change the drag method to use it instead of a pixbuf. origin commit: https://gitlab.gnome.org/GNOME/nautilus/commit/18a380af
1 parent ef78aa3 commit e28ff9c

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

‎src/file-manager/fm-list-view.c‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,13 @@ stop_drag_check (FMListView *view)
460460
view->details->drag_button = 0;
461461
}
462462

463-
static GdkPixbuf *
464-
get_drag_pixbuf (FMListView *view)
463+
static cairo_surface_t *
464+
get_drag_surface (FMListView *view)
465465
{
466466
GtkTreeModel *model;
467467
GtkTreePath *path;
468468
GtkTreeIter iter;
469-
GdkPixbuf *ret;
469+
cairo_surface_t *ret;
470470
GdkRectangle cell_area;
471471

472472
ret = NULL;
@@ -500,15 +500,12 @@ drag_begin_callback (GtkWidget *widget,
500500
FMListView *view)
501501
{
502502
GList *ref_list;
503-
GdkPixbuf *pixbuf;
503+
cairo_surface_t *surface;
504504

505-
pixbuf = get_drag_pixbuf (view);
506-
if (pixbuf)
507-
{
508-
gtk_drag_set_icon_pixbuf (context,
509-
pixbuf,
510-
0, 0);
511-
g_object_unref (pixbuf);
505+
surface = get_drag_surface (view);
506+
if (surface) {
507+
gtk_drag_set_icon_surface (context, surface);
508+
cairo_surface_destroy (surface);
512509
}
513510
else
514511
{

0 commit comments

Comments
 (0)