Merge lp:~desrt/libdbusmenu/no-reply-requested into lp:libdbusmenu/0.6

Proposed by Allison Karlitskaya
Status: Merged
Approved by: Ted Gould
Approved revision: 387
Merged at revision: 387
Proposed branch: lp:~desrt/libdbusmenu/no-reply-requested
Merge into: lp:libdbusmenu/0.6
Diff against target: 22 lines (+12/-0)
1 file modified
libdbusmenu-glib/client.c (+12/-0)
To merge this branch: bzr merge lp:~desrt/libdbusmenu/no-reply-requested
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+97935@code.launchpad.net

Description of the change

glib client: don't request a reply on send_event() if nobody is listening for it

Coupled with an upcoming GDBus patch this will halve the amount of D-Bus traffic generated by all the "opened" and "closed" signals transmitted by the HUD when searching (because the replies won't be sent).

This is one of many partial fixes for lp:957022

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-glib/client.c'
2--- libdbusmenu-glib/client.c 2012-03-01 16:55:24 +0000
3+++ libdbusmenu-glib/client.c 2012-03-16 17:30:47 +0000
4@@ -1540,6 +1540,18 @@
5 variant = g_variant_new_int32(0);
6 }
7
8+ /* Don't bother with the reply handling if nobody is watching... */
9+ if (!g_signal_has_handler_pending (client, signals[EVENT_RESULT], 0, TRUE)) {
10+ g_dbus_proxy_call(priv->menuproxy,
11+ "Event",
12+ g_variant_new("(isvu)", id, name, variant, timestamp),
13+ G_DBUS_CALL_FLAGS_NONE,
14+ 1000, /* timeout */
15+ NULL, /* cancellable */
16+ NULL, NULL);
17+ return;
18+ }
19+
20 event_data_t * edata = g_new0(event_data_t, 1);
21 edata->client = client;
22 g_object_ref(client);

Subscribers

People subscribed via source and target branches