aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-10-14 08:57:10 -0500
committerTed Gould <ted@gould.cx>2010-10-14 08:57:10 -0500
commit30691761c907afc9c5b33fa90e8cbbacc9745acd (patch)
tree9b3b17b93471b3947d858fa5a3dd95b7b287bb38
parentde67e00eb07dbd06b6c53798653a690bb9b5fe85 (diff)
parent761c9cc00f19001548d23fe09a3e1676e728ad73 (diff)
downloadlibdbusmenu-30691761c907afc9c5b33fa90e8cbbacc9745acd.tar.gz
libdbusmenu-30691761c907afc9c5b33fa90e8cbbacc9745acd.tar.bz2
libdbusmenu-30691761c907afc9c5b33fa90e8cbbacc9745acd.zip
Only force a flush for the top level of items.
-rw-r--r--libdbusmenu-glib/client.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 6a51764..dae1dd7 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;
}
@@ -1283,8 +1294,10 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it
/* We've got everything built up at this node and reconcilled */
- /* Flush the properties requests */
- get_properties_flush(client);
+ /* Flush the properties requests if this is the first level */
+ if (dbusmenu_menuitem_get_id(parent) == 0) {
+ get_properties_flush(client);
+ }
/* now it's time to recurse down the tree. */
children = node->children;