Skip to content

Commit

Permalink
list-view: use the cairo surface as a drag icon
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cosimoc authored and lukefromdc committed Apr 5, 2018
1 parent ef78aa3 commit e28ff9c
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/file-manager/fm-list-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,13 @@ stop_drag_check (FMListView *view)
view->details->drag_button = 0;
}

static GdkPixbuf *
get_drag_pixbuf (FMListView *view)
static cairo_surface_t *
get_drag_surface (FMListView *view)
{
GtkTreeModel *model;
GtkTreePath *path;
GtkTreeIter iter;
GdkPixbuf *ret;
cairo_surface_t *ret;
GdkRectangle cell_area;

ret = NULL;
Expand Down Expand Up @@ -500,15 +500,12 @@ drag_begin_callback (GtkWidget *widget,
FMListView *view)
{
GList *ref_list;
GdkPixbuf *pixbuf;
cairo_surface_t *surface;

pixbuf = get_drag_pixbuf (view);
if (pixbuf)
{
gtk_drag_set_icon_pixbuf (context,
pixbuf,
0, 0);
g_object_unref (pixbuf);
surface = get_drag_surface (view);
if (surface) {
gtk_drag_set_icon_surface (context, surface);
cairo_surface_destroy (surface);
}
else
{
Expand Down

0 comments on commit e28ff9c

Please sign in to comment.