[gtk+] iconhelper: always ensure a stated pixbuf



commit b0a0b7ebe7a1ee87cd05ef0600edd5c5200a72cd
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Aug 4 16:50:31 2013 +0200

    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 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index cda1e99..1dc3ce6 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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]