diff options
author | Ted Gould <ted@gould.cx> | 2012-04-03 09:48:46 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-04-03 09:48:46 -0500 |
commit | 5962851c31527fdb43a3d3b9b2c98ebeaaee88e8 (patch) | |
tree | 8afa1f5c230d464aaf146a74ebb4a283b76f46df | |
parent | 134cc4320738fb240d501892cafcf962eadda6ca (diff) | |
download | libdbusmenu-5962851c31527fdb43a3d3b9b2c98ebeaaee88e8.tar.gz libdbusmenu-5962851c31527fdb43a3d3b9b2c98ebeaaee88e8.tar.bz2 libdbusmenu-5962851c31527fdb43a3d3b9b2c98ebeaaee88e8.zip |
Set and get the event grouping and notify if we change it
-rw-r--r-- | libdbusmenu-glib/client.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 44b2902..6162c14 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -552,6 +552,9 @@ set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec) build_proxies(DBUSMENU_CLIENT(obj)); } break; + case PROP_GROUP_EVENTS: + priv->group_events = g_value_get_boolean(value); + break; default: g_warning("Unknown property %d.", id); return; @@ -578,6 +581,9 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) case PROP_TEXT_DIRECTION: g_value_set_enum(value, priv->text_direction); break; + case PROP_GROUP_EVENTS: + g_value_set_boolean(value, priv->group_events); + break; default: g_warning("Unknown property %d.", id); return; @@ -1164,12 +1170,19 @@ menuproxy_build_cb (GObject * object, GAsyncResult * res, gpointer user_data) remote_version = g_variant_get_uint32(version); } + gboolean old_group = priv->group_events; + /* Figure out if we can group the events or not */ if (remote_version >= 3) { priv->group_events = TRUE; } else { priv->group_events = FALSE; } + /* Notify listeners if we changed the value */ + if (old_group != priv->group_events) { + g_object_notify(G_OBJECT(client), DBUSMENU_CLIENT_PROP_GROUP_EVENTS); + } + g_variant_unref(version); version = NULL; } |