aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 6511589..3d15690 100644
--- a/src/app-indicator.c
+++ b/src/app-indicator.c
@@ -174,6 +174,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);
@@ -1749,6 +1750,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,
@@ -1813,6 +1822,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;