aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkarl-qdh <karl@qdh.org.uk>2011-03-03 14:59:17 +0000
committerkarl-qdh <karl@qdh.org.uk>2011-03-03 14:59:17 +0000
commit3aa4316f935bead55058441956d8b80e01146199 (patch)
tree6bde3aafd30f4eb709e6b2a00ddc463bb548d2b9
parent76825a8ee0227c18fd02a30ab74ecc5a95382b6d (diff)
downloadayatana-indicator-datetime-3aa4316f935bead55058441956d8b80e01146199.tar.gz
ayatana-indicator-datetime-3aa4316f935bead55058441956d8b80e01146199.tar.bz2
ayatana-indicator-datetime-3aa4316f935bead55058441956d8b80e01146199.zip
Width appears to be repeatedly overwritten with zero
-rw-r--r--src/datetime-service.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index fd14af9..7b135a8 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -643,6 +643,9 @@ update_appointment_menu_items (gpointer user_data)
comp_instances = NULL;
i = 0;
+ gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
+ if (width == 0) width = 12;
+ if (height == 0) height = 12;
for (l = sorted_comp_instances; l; l = l->next) {
struct comp_instance *ci = l->data;
ECalComponent *ecalcomp = ci->comp;
@@ -743,13 +746,11 @@ update_appointment_menu_items (gpointer user_data)
// Fixme causes segfault, but we have colours now yay!
GdkColor color;
gdk_color_parse (color_spec, &color);
-
- gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
- if (width == 0) width = 12;
- if (height == 0) height = 12;
cairo_surface_t *surface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, width, height );
-
+ // Width keeps becoming zero!!
+ if (width == 0) width = 12;
+ if (height == 0) height = 12;
cairo_t *cr = cairo_create(surface);
gdk_cairo_set_source_color(cr, &color);
cairo_paint(cr);
@@ -759,6 +760,9 @@ update_appointment_menu_items (gpointer user_data)
cairo_stroke(cr);
// Convert to pixbuf, in gtk3 this is done with gdk_pixbuf_get_from_surface
cairo_content_t content = cairo_surface_get_content (surface) | CAIRO_CONTENT_COLOR;
+ // Width keeps becoming zero!!
+ if (width == 0) width = 12;
+ if (height == 0) height = 12;
GdkPixbuf *pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
!!(content & CAIRO_CONTENT_ALPHA),
8, width, height);