aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSense Egbert Hofstede <sense@ubuntu.com>2010-08-05 18:25:57 +0200
committerSense Egbert Hofstede <sense@ubuntu.com>2010-08-05 18:25:57 +0200
commit1a0c666b3461d13265a52d35e38d260d975f02aa (patch)
tree2394185d0890b12d7240dc4308775bacc0296406 /src
parent17dea0907c51dfb39686f6840a9404467d79db82 (diff)
downloadlibayatana-appindicator-1a0c666b3461d13265a52d35e38d260d975f02aa.tar.gz
libayatana-appindicator-1a0c666b3461d13265a52d35e38d260d975f02aa.tar.bz2
libayatana-appindicator-1a0c666b3461d13265a52d35e38d260d975f02aa.zip
Partial, segfaulting, fix for LP: #608219, requires GTK+ change attached to same bug report.
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;