summaryrefslogtreecommitdiff
path: root/gtk/gtkdragsource.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2017-10-23 15:15:35 +0200
committerAlexander Larsson <alexl@redhat.com>2017-10-23 15:28:33 +0200
commit61b2ab5d9083a1e21e79d077dfcdfb40439a1693 (patch)
tree16c97fbeca8e01e6b34c36cd7603bf3b7d4fdcc7 /gtk/gtkdragsource.c
parente205ae9fc1ce366aa2231577025a0ecfa25f64fb (diff)
downloadgtk+-61b2ab5d9083a1e21e79d077dfcdfb40439a1693.tar.gz
GtkDragSource: Don't use gtk_image_definition_new_pixbuf
We want to get rid of pixbuf image definitions. Long term this should probably be gtk_drag_source_set_icon_surface instead.
Diffstat (limited to 'gtk/gtkdragsource.c')
-rw-r--r--gtk/gtkdragsource.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkdragsource.c b/gtk/gtkdragsource.c
index 4c701b4599..6ed5e942d9 100644
--- a/gtk/gtkdragsource.c
+++ b/gtk/gtkdragsource.c
@@ -362,6 +362,7 @@ gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
GdkPixbuf *pixbuf)
{
GtkDragSourceSite *site;
+ cairo_surface_t *surface = NULL;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
@@ -370,7 +371,9 @@ gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
g_return_if_fail (site != NULL);
g_clear_pointer (&site->image_def, gtk_image_definition_unref);
- site->image_def = gtk_image_definition_new_pixbuf (pixbuf, 1);
+ surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, gtk_widget_get_window (widget));
+ site->image_def = gtk_image_definition_new_surface (surface);
+ cairo_surface_destroy (surface);
}
/**