aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app-indicator.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c
index 32f512f..3611d74 100644
--- a/src/app-indicator.c
+++ b/src/app-indicator.c
@@ -149,6 +149,7 @@ static gchar * append_panel_icon_suffix (const gchar * icon_name);
static void watcher_proxy_destroyed (GObject * object, gpointer data);
static void client_menu_changed (GtkWidget *widget, GtkWidget *child, AppIndicator *indicator);
static void submenu_changed (GtkWidget *widget, GtkWidget *child, gpointer data);
+static void submenu_added (GtkWidget *widget, GtkWidget *submenu, gpointer data);
static void theme_changed_cb (GtkIconTheme * theme, gpointer user_data);
@@ -1418,6 +1419,14 @@ container_iterate (GtkWidget *widget,
child,
0);
}
+ g_signal_connect (GTK_MENU_ITEM(widget),
+ "submenu-added",
+ G_CALLBACK (submenu_added),
+ child);
+ g_signal_connect (GTK_MENU_ITEM(widget),
+ "submenu-removed",
+ G_CALLBACK (submenu_changed),
+ child);
}
dbusmenu_menuitem_property_set_bool (child,
@@ -1482,6 +1491,28 @@ submenu_changed (GtkWidget *widget,
}
static void
+submenu_added (GtkWidget *widget,
+ GtkWidget *submenu,
+ gpointer data)
+{
+ DbusmenuMenuitem *root = (DbusmenuMenuitem *)data;
+
+ gtk_container_foreach (GTK_CONTAINER (submenu),
+ container_iterate,
+ root);
+ g_signal_connect_object (GTK_MENU(submenu),
+ "child-added",
+ G_CALLBACK (submenu_changed),
+ root,
+ 0);
+ g_signal_connect_object (GTK_MENU(submenu),
+ "child-removed",
+ G_CALLBACK (submenu_changed),
+ root,
+ 0);
+}
+
+static void
setup_dbusmenu (AppIndicator *self)
{
AppIndicatorPrivate *priv;