Commit 18a380af authored by Cosimo Cecchi's avatar Cosimo Cecchi

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.
parent 6f32b422
...@@ -396,13 +396,13 @@ stop_drag_check (NautilusListView *view) ...@@ -396,13 +396,13 @@ stop_drag_check (NautilusListView *view)
view->details->drag_button = 0; view->details->drag_button = 0;
} }
static GdkPixbuf * static cairo_surface_t *
get_drag_pixbuf (NautilusListView *view) get_drag_surface (NautilusListView *view)
{ {
GtkTreeModel *model; GtkTreeModel *model;
GtkTreePath *path; GtkTreePath *path;
GtkTreeIter iter; GtkTreeIter iter;
GdkPixbuf *ret; cairo_surface_t *ret;
GdkRectangle cell_area; GdkRectangle cell_area;
ret = NULL; ret = NULL;
...@@ -503,14 +503,12 @@ drag_begin_callback (GtkWidget *widget, ...@@ -503,14 +503,12 @@ drag_begin_callback (GtkWidget *widget,
NautilusListView *view) NautilusListView *view)
{ {
GList *selection_cache; GList *selection_cache;
GdkPixbuf *pixbuf; cairo_surface_t *surface;
pixbuf = get_drag_pixbuf (view); surface = get_drag_surface (view);
if (pixbuf) { if (surface) {
gtk_drag_set_icon_pixbuf (context, gtk_drag_set_icon_surface (context, surface);
pixbuf, cairo_surface_destroy (surface);
0, 0);
g_object_unref (pixbuf);
} else { } else {
gtk_drag_set_icon_default (context); gtk_drag_set_icon_default (context);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment