diff options
author | Cosimo Cecchi <[email protected]> | 2013-08-05 03:54:18 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-04-05 09:08:56 +0200 |
commit | 0630180fcb42da1c6ecd95eb0bba41e71a567b27 (patch) | |
tree | 8baf8e161d356ea2d711c34635daa3b7939008f5 | |
parent | 1a14801e9e24139efd5bff2a351405fd05d44096 (diff) | |
download | caja-0630180fcb42da1c6ecd95eb0bba41e71a567b27.tar.bz2 caja-0630180fcb42da1c6ecd95eb0bba41e71a567b27.tar.xz |
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
-rw-r--r-- | src/file-manager/fm-list-view.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index ddae3415..4b5b89a1 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -459,13 +459,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; @@ -499,15 +499,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 { |