diff options
author | Ryan Lortie <desrt@desrt.ca> | 2012-03-16 13:26:58 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2012-03-16 13:26:58 -0400 |
commit | f14ada4c5aa39ae4fd556b00c21a9db35e24bff5 (patch) | |
tree | eeabd3aa28e4b00049bb2fce19c6c8a63a4065a3 /libdbusmenu-glib | |
parent | b314d39809c37d6beff47389d3dfaedf058c0fcd (diff) | |
download | libdbusmenu-f14ada4c5aa39ae4fd556b00c21a9db35e24bff5.tar.gz libdbusmenu-f14ada4c5aa39ae4fd556b00c21a9db35e24bff5.tar.bz2 libdbusmenu-f14ada4c5aa39ae4fd556b00c21a9db35e24bff5.zip |
glib client: don't request a reply on send_event() if nobody is listening for it
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 01f063d..7d96db3 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1540,6 +1540,18 @@ dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name variant = g_variant_new_int32(0); } + /* Don't bother with the reply handling if nobody is watching... */ + if (!g_signal_has_handler_pending (client, signals[EVENT_RESULT], 0, TRUE)) { + g_dbus_proxy_call(priv->menuproxy, + "Event", + g_variant_new("(isvu)", id, name, variant, timestamp), + G_DBUS_CALL_FLAGS_NONE, + 1000, /* timeout */ + NULL, /* cancellable */ + NULL, NULL); + return; + } + event_data_t * edata = g_new0(event_data_t, 1); edata->client = client; g_object_ref(client); |