aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-04-07 10:24:32 -0500
committerTed Gould <ted@gould.cx>2011-04-07 10:24:32 -0500
commitf0ab3958e1f7c9b817a5556120ba5c8a12ecbd1c (patch)
tree9a756d43787ffc01f60b651b10b30205ef28c55a /libdbusmenu-glib
parent269670511328aada39a23bd982a1ca3a44de9cfe (diff)
parent4f43bbc76e738ecb3b03d848b447ac9dfe64faa3 (diff)
downloadlibdbusmenu-f0ab3958e1f7c9b817a5556120ba5c8a12ecbd1c.tar.gz
libdbusmenu-f0ab3958e1f7c9b817a5556120ba5c8a12ecbd1c.tar.bz2
libdbusmenu-f0ab3958e1f7c9b817a5556120ba5c8a12ecbd1c.zip
Import upstream version 0.4.2
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/client.c14
-rw-r--r--libdbusmenu-glib/menuitem.c2
2 files changed, 12 insertions, 4 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index ef89705..45cf0d1 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -331,6 +331,8 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass)
return;
}
+#define LAYOUT_PROPS_COUNT 5
+
static void
dbusmenu_client_init (DbusmenuClient *self)
{
@@ -351,13 +353,14 @@ dbusmenu_client_init (DbusmenuClient *self)
priv->layoutcall = NULL;
- gchar * layout_props[5];
+ gchar * layout_props[LAYOUT_PROPS_COUNT + 1];
layout_props[0] = DBUSMENU_MENUITEM_PROP_TYPE;
layout_props[1] = DBUSMENU_MENUITEM_PROP_LABEL;
layout_props[2] = DBUSMENU_MENUITEM_PROP_VISIBLE;
layout_props[3] = DBUSMENU_MENUITEM_PROP_ENABLED;
- layout_props[4] = NULL;
- priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, 4);
+ layout_props[4] = DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY;
+ layout_props[LAYOUT_PROPS_COUNT] = NULL;
+ priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, LAYOUT_PROPS_COUNT);
g_variant_ref_sink(priv->layout_props);
priv->current_revision = 0;
@@ -441,6 +444,9 @@ dbusmenu_client_dispose (GObject *object)
priv->menuproxy_cancel = NULL;
}
if (priv->menuproxy != NULL) {
+ g_signal_handlers_disconnect_matched(priv->menuproxy,
+ G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, object);
g_object_unref(G_OBJECT(priv->menuproxy));
priv->menuproxy = NULL;
}
@@ -1494,6 +1500,7 @@ menuitem_call_cb (GObject * proxy, GAsyncResult * res, gpointer userdata)
g_variant_unref(edata->variant);
g_free(edata->event);
g_object_unref(edata->menuitem);
+ g_object_unref(edata->client);
g_free(edata);
if (G_UNLIKELY(error != NULL)) {
@@ -1528,6 +1535,7 @@ dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name
event_data_t * edata = g_new0(event_data_t, 1);
edata->client = client;
+ g_object_ref(client);
edata->menuitem = mi;
g_object_ref(edata->menuitem);
edata->event = g_strdup(name);
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index 70b5fd2..bdaf49f 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -446,7 +446,7 @@ send_about_to_show (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gp
{
g_return_if_fail(DBUSMENU_IS_MENUITEM(mi));
- if (dbusmenu_menuitem_get_children(mi) == NULL) {
+ if (dbusmenu_menuitem_get_children(mi) == NULL && g_strcmp0(DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU, dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY)) != 0) {
g_warning("About to Show called on an item wihtout submenus. We're ignoring it.");
} else {
gboolean dummy;