aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2020-08-16 14:55:23 +0200
committerRobert Tari <robert@tari.in>2020-08-16 14:55:23 +0200
commitb6fd2c19c59f24fe8f0feb5a2f9d0caf67a55452 (patch)
tree538c4e13d8d0fe8800714809abf2785f5d529f19
parent8beffb391ed814ccf1cf38e60050b105fa3d7caa (diff)
downloadlibayatana-indicator-b6fd2c19c59f24fe8f0feb5a2f9d0caf67a55452.tar.gz
libayatana-indicator-b6fd2c19c59f24fe8f0feb5a2f9d0caf67a55452.tar.bz2
libayatana-indicator-b6fd2c19c59f24fe8f0feb5a2f9d0caf67a55452.zip
Fix IDO insertion index in Indicator Messages with multiple clients
-rw-r--r--libayatana-indicator/indicator-ng.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c
index 598a66f..fa4fb8a 100644
--- a/libayatana-indicator/indicator-ng.c
+++ b/libayatana-indicator/indicator-ng.c
@@ -349,6 +349,17 @@ static void indicator_ng_menu_section_changed(GMenuModel *pMenuSection, gint nPo
{
guint nItems = g_menu_model_get_n_items(pSubsection);
+ // Skip the subsection separator (if there is one)
+ GList *lMenuItems = gtk_container_get_children(GTK_CONTAINER(self->entry.menu));
+ GtkWidget *pMenuItem = GTK_WIDGET(g_list_nth_data(lMenuItems, nMenuItem));
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM(pMenuItem))
+ {
+ nMenuItem++;
+ }
+
+ g_list_free(lMenuItems);
+
for (guint nItem = 0; nItem < nItems; nItem++)
{
bChanged = indicator_ng_menu_insert_idos(self, pSubsection, nItem, nMenuItem, bNamespace, sNamespace) || bChanged;