aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-10-17 20:04:16 +0000
committerTarmac <Unknown>2013-10-17 20:04:16 +0000
commitde955883dad3e19fd32c62e0e26294fff05a3cc8 (patch)
tree64888747e8345308959192d1f8738b981790fb60
parentccf83adc58fc38a5b7134f07cbd0bca1545b1f32 (diff)
parent244d6180f63e12a4b1726fc223d3c00ab6bbb316 (diff)
downloadlibayatana-indicator-de955883dad3e19fd32c62e0e26294fff05a3cc8.tar.gz
libayatana-indicator-de955883dad3e19fd32c62e0e26294fff05a3cc8.tar.bz2
libayatana-indicator-de955883dad3e19fd32c62e0e26294fff05a3cc8.zip
indicator-ng: always create entry.label and entry.image
They used to be created lazily when the root menu item changed to include and image or a label. However, there is no way to notify a panel that this happened. Panels connect to notify signals on these widgets when an entry gets added. If the widgets don't exist from the very beginning, the panel won't update when they change. . Fixes: https://bugs.launchpad.net/bugs/1220204. Approved by Charles Kerr, PS Jenkins bot.
-rw-r--r--libindicator/indicator-ng.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libindicator/indicator-ng.c b/libindicator/indicator-ng.c
index f2ffa6d..87deb14 100644
--- a/libindicator/indicator-ng.c
+++ b/libindicator/indicator-ng.c
@@ -240,9 +240,6 @@ indicator_ng_set_icon_from_variant (IndicatorNg *self,
return;
}
- if (!self->entry.image)
- self->entry.image = g_object_ref_sink (gtk_image_new ());
-
gtk_widget_show (GTK_WIDGET (self->entry.image));
icon = g_icon_deserialize (variant);
@@ -271,9 +268,6 @@ indicator_ng_set_label (IndicatorNg *self,
return;
}
- if (!self->entry.label)
- self->entry.label = g_object_ref_sink (gtk_label_new (NULL));
-
gtk_label_set_label (GTK_LABEL (self->entry.label), label);
gtk_widget_show (GTK_WIDGET (self->entry.label));
}
@@ -655,6 +649,9 @@ indicator_ng_initable_iface_init (GInitableIface *initable)
static void
indicator_ng_init (IndicatorNg *self)
{
+ self->entry.label = g_object_ref_sink (gtk_label_new (NULL));
+ self->entry.image = g_object_ref_sink (gtk_image_new ());
+
self->entry.menu = g_object_ref_sink (gtk_menu_new ());
/* work around IndicatorObject's warning that the accessible