aboutsummaryrefslogtreecommitdiff
path: root/src/app-section.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-06-04 11:56:15 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-06-04 11:56:15 +0200
commitcd8e4e8d16d67c6601a0536fc2554bc45c10728e (patch)
tree1f04d248de51ea5f6da70cadcc2035760e32930a /src/app-section.c
parent7eae3f378e7d1b3bf4cc291649dfb35b8e2b93eb (diff)
downloadayatana-indicator-messages-cd8e4e8d16d67c6601a0536fc2554bc45c10728e.tar.gz
ayatana-indicator-messages-cd8e4e8d16d67c6601a0536fc2554bc45c10728e.tar.bz2
ayatana-indicator-messages-cd8e4e8d16d67c6601a0536fc2554bc45c10728e.zip
Reexport application menu as a separate section below the shortcuts
Diffstat (limited to 'src/app-section.c')
-rw-r--r--src/app-section.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/app-section.c b/src/app-section.c
index 61d4db3..b59bfc1 100644
--- a/src/app-section.c
+++ b/src/app-section.c
@@ -391,11 +391,17 @@ app_section_set_object_path (AppSection *self,
if (priv->name_watch_id)
g_bus_unwatch_name (priv->name_watch_id);
g_clear_object (&priv->actions);
- g_clear_object (&priv->remote_menu);
+
+ if (priv->remote_menu) {
+ g_menu_remove (priv->menu, 0);
+ g_clear_object (&priv->remote_menu);
+ }
priv->actions = G_ACTION_GROUP (g_dbus_action_group_get (bus, bus_name, object_path));
priv->remote_menu = G_MENU_MODEL (g_dbus_menu_model_get (bus, bus_name, object_path));
+ g_menu_append_section (priv->menu, NULL, priv->remote_menu);
+
priv->name_watch_id = g_bus_watch_name_on_connection (bus, bus_name, 0,
NULL, application_vanished,
self, NULL);
@@ -421,7 +427,11 @@ app_section_unset_object_path (AppSection *self)
priv->name_watch_id = 0;
}
g_clear_object (&priv->actions);
- g_clear_object (&priv->remote_menu);
+
+ if (priv->remote_menu) {
+ g_menu_remove (priv->menu, 0);
+ g_clear_object (&priv->remote_menu);
+ }
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ACTIONS]);
}