From 761c9cc00f19001548d23fe09a3e1676e728ad73 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 27 Sep 2010 20:15:46 -0500 Subject: Set a maximum number of entries to queue before sending the message. --- libdbusmenu-glib/client.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 91dc356..52cb24f 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -43,6 +43,10 @@ License version 3 and version 2.1 along with this program. If not, see #include "server-marshal.h" #include "client-marshal.h" +/* How many property requests should we queue before + sending the message on dbus */ +#define MAX_PROPERTIES_TO_QUEUE 100 + /* Properties */ enum { PROP_0, @@ -628,6 +632,13 @@ get_properties_globber (DbusmenuClient * client, gint id, const gchar ** propert priv->delayed_idle = g_idle_add(get_properties_idle, client); } + /* Look at how many proprites we have queued up and + make it so that we don't leave too many in one + request. */ + if (priv->delayed_property_listeners->len == MAX_PROPERTIES_TO_QUEUE) { + get_properties_flush(client); + } + return; } -- cgit v1.2.3