aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog13
-rw-r--r--libindicator/indicator-ng.c34
2 files changed, 47 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 71b27f6..0f2faa6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+libindicator (12.10.2+14.04.20140129-0ubuntu1) trusty; urgency=low
+
+ [ Colin Watson ]
+ * Use named icons rather than (deprecated) stock items. (LP: #1262626)
+
+ [ Lars Uebernickel ]
+ * Don't treat deprecation warnings as errors and fix indicator-ng test
+ for gtk 3.10. (LP: #1262626)
+ * indicator-ng: support "submenu-action" on root menu items (LP:
+ #793450)
+
+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 29 Jan 2014 16:47:10 +0000
+
libindicator (12.10.2+14.04.20131125-0ubuntu2) trusty; urgency=medium
* Build with -Wno-error=deprecated-declarations.
diff --git a/libindicator/indicator-ng.c b/libindicator/indicator-ng.c
index c7a4899..d83a2b5 100644
--- a/libindicator/indicator-ng.c
+++ b/libindicator/indicator-ng.c
@@ -35,6 +35,7 @@ struct _IndicatorNg
gchar *header_action;
gchar *scroll_action;
gchar *secondary_action;
+ gchar *submenu_action;
gint position;
guint name_watch_id;
@@ -162,6 +163,7 @@ indicator_ng_finalize (GObject *object)
g_free (self->header_action);
g_free (self->scroll_action);
g_free (self->secondary_action);
+ g_free (self->submenu_action);
G_OBJECT_CLASS (indicator_ng_parent_class)->finalize (object);
}
@@ -214,6 +216,28 @@ indicator_ng_secondary_activate (IndicatorObject *io,
}
static void
+indicator_ng_menu_shown (GtkWidget *widget,
+ gpointer user_data)
+{
+ IndicatorNg *self = user_data;
+
+ if (self->submenu_action)
+ g_action_group_change_action_state (self->actions, self->submenu_action,
+ g_variant_new_boolean (TRUE));
+}
+
+static void
+indicator_ng_menu_hidden (GtkWidget *widget,
+ gpointer user_data)
+{
+ IndicatorNg *self = user_data;
+
+ if (self->submenu_action)
+ g_action_group_change_action_state (self->actions, self->submenu_action,
+ g_variant_new_boolean (FALSE));
+}
+
+static void
indicator_ng_set_accessible_desc (IndicatorNg *self,
const gchar *accessible_desc)
{
@@ -390,6 +414,13 @@ indicator_ng_menu_changed (GMenuModel *menu,
g_free (action);
}
+ if (g_menu_model_get_item_attribute (self->menu, 0, "submenu-action", "s", &action))
+ {
+ if (g_str_has_prefix (action, "indicator."))
+ self->submenu_action = g_strdup (action + strlen ("indicator."));
+ g_free (action);
+ }
+
popup = g_menu_model_get_item_link (self->menu, 0, G_MENU_LINK_SUBMENU);
if (popup)
{
@@ -657,6 +688,9 @@ indicator_ng_init (IndicatorNg *self)
self->entry.menu = g_object_ref_sink (gtk_menu_new ());
+ g_signal_connect (self->entry.menu, "show", G_CALLBACK (indicator_ng_menu_shown), self);
+ g_signal_connect (self->entry.menu, "hide", G_CALLBACK (indicator_ng_menu_hidden), self);
+
/* work around IndicatorObject's warning that the accessible
* description is missing. We never set it on construction, but when
* the menu model has arrived on the bus.