[gnome-panel/gtk3] clock: Do not try to get width/height of non-existing GdkPixbuf



commit 4729df0cda021c27b76be072023dbee082e49e47
Author: Vincent Untz <vuntz gnome org>
Date:   Mon Jan 31 17:32:08 2011 +0100

    clock: Do not try to get width/height of non-existing GdkPixbuf

 applets/clock/clock-map.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/applets/clock/clock-map.c b/applets/clock/clock-map.c
index fe29010..82bfdf1 100644
--- a/applets/clock/clock-map.c
+++ b/applets/clock/clock-map.c
@@ -232,15 +232,14 @@ clock_map_draw (GtkWidget *this, cairo_t *cr)
         context = gtk_widget_get_style_context (this);
         gtk_style_context_get_color (context, GTK_STATE_FLAG_ACTIVE, &color);
 
-        width = gdk_pixbuf_get_width (priv->shadow_map_pixbuf);
-        height = gdk_pixbuf_get_height (priv->shadow_map_pixbuf);
-
-        // FIXMEchpe fix this!
 	if (!priv->shadow_map_pixbuf) {
                 g_warning ("Needed to refresh the map in draw event.");
 		clock_map_refresh (CLOCK_MAP (this));
         }
 
+        width = gdk_pixbuf_get_width (priv->shadow_map_pixbuf);
+        height = gdk_pixbuf_get_height (priv->shadow_map_pixbuf);
+
         gdk_cairo_set_source_pixbuf (cr, priv->shadow_map_pixbuf, 0, 0);
         cairo_rectangle (cr, 0, 0, width, height);
         cairo_paint (cr);



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