From b0a0b7ebe7a1ee87cd05ef0600edd5c5200a72cd Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sun, 4 Aug 2013 16:50:31 +0200 Subject: [PATCH] iconhelper: always ensure a stated pixbuf Even when we are set a pixbuf itself. https://bugzilla.gnome.org/show_bug.cgi?id=726271 --- gtk/gtkiconhelper.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index cda1e9976d..1dc3ce6535 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -388,6 +388,7 @@ ensure_pixbuf_at_size (GtkIconHelper *self, GtkStyleContext *context) { gint width, height; + GdkPixbuf *stated; if (!check_invalidate_pixbuf (self, context)) return; @@ -427,6 +428,10 @@ ensure_pixbuf_at_size (GtkIconHelper *self, if (!self->priv->rendered_pixbuf) self->priv->rendered_pixbuf = g_object_ref (self->priv->orig_pixbuf); + + stated = ensure_stated_pixbuf_from_pixbuf (self, context, self->priv->rendered_pixbuf); + g_object_unref (self->priv->rendered_pixbuf); + self->priv->rendered_pixbuf = stated; } GdkPixbuf * @@ -545,7 +550,7 @@ ensure_surface_from_pixbuf (GtkIconHelper *self, GtkStyleContext *context) { gint width, height; - GdkPixbuf *pixbuf; + GdkPixbuf *pixbuf, *stated; int scale; if (!check_invalidate_surface (self, context)) @@ -585,6 +590,10 @@ ensure_surface_from_pixbuf (GtkIconHelper *self, scale = self->priv->orig_pixbuf_scale; } + stated = ensure_stated_pixbuf_from_pixbuf (self, context, pixbuf); + g_object_unref (pixbuf); + pixbuf = stated; + self->priv->rendered_surface_width = (gdk_pixbuf_get_width (pixbuf) + scale - 1) / scale; self->priv->rendered_surface_height = (gdk_pixbuf_get_height (pixbuf) + scale - 1) / scale;