aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/client.c
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-08-24 20:46:15 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-08-24 20:46:15 -0400
commit9ceb41ac228d78973195973d65a1bccd4ea50f0d (patch)
tree91238ccdf2f336656583b8964e0d7d120de9ba22 /libdbusmenu-gtk/client.c
parentcb4fecf5e6eec692069d4e2417f58a77d604887f (diff)
parentc2fe3f52956cf27d76cc7c6f1ca0e29937c66c82 (diff)
downloadlibdbusmenu-9ceb41ac228d78973195973d65a1bccd4ea50f0d.tar.gz
libdbusmenu-9ceb41ac228d78973195973d65a1bccd4ea50f0d.tar.bz2
libdbusmenu-9ceb41ac228d78973195973d65a1bccd4ea50f0d.zip
* New upstream release (0.4.91).
* Add in a property for setting the menuitem disposition * New upstream release (0.4.92). * Fix GTK 2 build for style properties * Fixed proxied menu events not getting returned (LP: #799878) * Removed debian/patches: * All upstream * debian/libdbusmenu-gtk4.symbols debian/libdbusmenu-gtk3-4.symbols - Added new symbols
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r--libdbusmenu-gtk/client.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index 5e59f8e..1051f20 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -31,10 +31,12 @@ License version 3 and version 2.1 along with this program. If not, see
#endif
#include <gtk/gtk.h>
+#include <glib.h>
#include "client.h"
#include "menuitem.h"
#include "genericmenuitem.h"
+#include "genericmenuitem-enum-types.h"
/* Private */
struct _DbusmenuGtkClientPrivate {
@@ -701,6 +703,20 @@ process_submenu (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, D
return;
}
+/* Process the disposition changing */
+static void
+process_disposition (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, DbusmenuGtkClient * gtkclient)
+{
+ /* We can only handle generic menu items here. Perhaps someone else
+ will find the value useful. Not us. */
+ if (!IS_GENERICMENUITEM(gmi)) {
+ return;
+ }
+
+ genericmenuitem_set_disposition(GENERICMENUITEM(gmi), genericmenuitem_disposition_get_value_from_nick(g_variant_get_string(variant, NULL)));
+ return;
+}
+
/* Whenever we have a property change on a DbusmenuMenuitem
we need to be responsive to that. */
static void
@@ -720,6 +736,8 @@ menu_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * variant, Db
process_toggle_state(mi, gmi, variant);
} else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY)) {
process_submenu(mi, gmi, variant, gtkclient);
+ } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_DISPOSITION)) {
+ process_disposition(mi, gmi, variant, gtkclient);
}
return;
@@ -856,6 +874,7 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem *
process_toggle_type(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE));
process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE));
process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client);
+ process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client);
refresh_shortcut(client, item);
/* Oh, we're a child, let's deal with that */