From 134cc4320738fb240d501892cafcf962eadda6ca Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 3 Apr 2012 09:44:33 -0500 Subject: Add a property to whether we should group events or not --- libdbusmenu-glib/client.c | 7 ++++++- libdbusmenu-glib/client.h | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-glib') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 67beddb..44b2902 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -52,7 +52,8 @@ enum { PROP_DBUSOBJECT, PROP_DBUSNAME, PROP_STATUS, - PROP_TEXT_DIRECTION + PROP_TEXT_DIRECTION, + PROP_GROUP_EVENTS }; /* Signals */ @@ -321,6 +322,10 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass) "Signals which direction the default text direction is for the menus", DBUSMENU_TYPE_TEXT_DIRECTION, DBUSMENU_TEXT_DIRECTION_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (object_class, PROP_GROUP_EVENTS, + g_param_spec_boolean(DBUSMENU_CLIENT_PROP_GROUP_EVENTS, "Whether or not multiple events should be grouped", + "Event grouping lowers the number of messages on DBus and will be set automatically based on the version to optimize traffic. It can be disabled for testing or other purposes.", + FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); if (dbusmenu_node_info == NULL) { GError * error = NULL; diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index d0fca32..ae22863 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -105,6 +105,12 @@ G_BEGIN_DECLS * String to access property #DbusmenuClient:text-direction */ #define DBUSMENU_CLIENT_PROP_TEXT_DIRECTION "text-direction" +/** + * DBUSMENU_CLIENT_PROP_GROUP_EVENTS: + * + * String to access property #DbusmenuClient:group-events + */ +#define DBUSMENU_CLIENT_PROP_GROUP_EVENTS "group-events" /** * DBUSMENU_CLIENT_TYPES_DEFAULT: -- cgit v1.2.3