Skip to content

Commit 0630180

Browse files
cosimocraveit65
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 1a14801 commit 0630180

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
@@ -459,13 +459,13 @@ stop_drag_check (FMListView *view)
459459
view->details->drag_button = 0;
460460
}
461461

462-
static GdkPixbuf *
463-
get_drag_pixbuf (FMListView *view)
462+
static cairo_surface_t *
463+
get_drag_surface (FMListView *view)
464464
{
465465
GtkTreeModel *model;
466466
GtkTreePath *path;
467467
GtkTreeIter iter;
468-
GdkPixbuf *ret;
468+
cairo_surface_t *ret;
469469
GdkRectangle cell_area;
470470

471471
ret = NULL;
@@ -499,15 +499,12 @@ drag_begin_callback (GtkWidget *widget,
499499
FMListView *view)
500500
{
501501
GList *ref_list;
502-
GdkPixbuf *pixbuf;
502+
cairo_surface_t *surface;
503503

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

0 commit comments

Comments
 (0)