aboutsummaryrefslogtreecommitdiff
path: root/src/libappindicator
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-11 23:12:57 -0600
committerTed Gould <ted@gould.cx>2010-02-11 23:12:57 -0600
commita98fd45c6f4e19d998e55c17a61c8860e6834049 (patch)
treef1782742789d711977d00a7006d96d89578f2aa3 /src/libappindicator
parent14abe9ad1ff1b09526b6f0f6410c2783e6dbd501 (diff)
parentaf5ac815104f9a9ec2f0f86264441b536965f7b2 (diff)
downloadayatana-indicator-application-a98fd45c6f4e19d998e55c17a61c8860e6834049.tar.gz
ayatana-indicator-application-a98fd45c6f4e19d998e55c17a61c8860e6834049.tar.bz2
ayatana-indicator-application-a98fd45c6f4e19d998e55c17a61c8860e6834049.zip
Adding in submenu support.
Diffstat (limited to 'src/libappindicator')
-rw-r--r--src/libappindicator/app-indicator.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c
index 0ca68d4..d179df7 100644
--- a/src/libappindicator/app-indicator.c
+++ b/src/libappindicator/app-indicator.c
@@ -1133,6 +1133,7 @@ container_iterate (GtkWidget *widget,
{
DbusmenuMenuitem *root = (DbusmenuMenuitem *)data;
DbusmenuMenuitem *child;
+ GtkWidget *submenu = NULL;
const gchar *label = NULL;
gboolean label_set = FALSE;
@@ -1213,6 +1214,17 @@ container_iterate (GtkWidget *widget,
}
}
+ if (GTK_IS_MENU_ITEM (widget))
+ {
+ submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
+ if (submenu != NULL)
+ {
+ gtk_container_forall (GTK_CONTAINER (submenu),
+ container_iterate,
+ child);
+ }
+ }
+
g_signal_connect (widget, "notify",
G_CALLBACK (widget_notify_cb), child);
@@ -1235,11 +1247,12 @@ setup_dbusmenu (AppIndicator *self)
container_iterate,
root);
- if (priv->menuservice == NULL) {
- gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s/Menu", priv->clean_id);
- priv->menuservice = dbusmenu_server_new (path);
- g_free(path);
- }
+ if (priv->menuservice == NULL)
+ {
+ gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s/Menu", priv->clean_id);
+ priv->menuservice = dbusmenu_server_new (path);
+ g_free(path);
+ }
dbusmenu_server_set_root (priv->menuservice, root);