diff options
-rw-r--r-- | libayatana-indicator/indicator-ng.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c index 5d34139..b31d298 100644 --- a/libayatana-indicator/indicator-ng.c +++ b/libayatana-indicator/indicator-ng.c @@ -354,12 +354,13 @@ static void indicator_ng_menu_section_changed(GMenuModel *pMenuSection, gint nPo for (guint nSection = 0; nSection < nSections; nSection++) { GMenuModel *pSection = g_menu_model_get_item_link(pModel, nSection, G_MENU_LINK_SECTION); + guint nSubsections = 0; if (pSection) { gchar *sNamespace; gboolean bNamespace = g_menu_model_get_item_attribute(pModel, nSection, G_MENU_ATTRIBUTE_ACTION_NAMESPACE, "s", &sNamespace); - guint nSubsections = g_menu_model_get_n_items(pSection); + nSubsections = g_menu_model_get_n_items(pSection); for (guint nSubsection = 0; nSubsection < nSubsections; nSubsection++) { @@ -405,7 +406,7 @@ static void indicator_ng_menu_section_changed(GMenuModel *pMenuSection, gint nPo g_object_unref(pSection); } - if (!g_str_equal(self->name, "ayatana-indicator-messages")) + if (pSection && nSubsections) { nMenuItem++; } |