aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/client.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-30 09:47:54 -0500
committerTed Gould <ted@gould.cx>2010-08-30 09:47:54 -0500
commitddd09f68a4d3e991b3db7a1f1a67408bba4875e4 (patch)
tree37a71313185898422cf47c213566c605bc9d4fe8 /libdbusmenu-glib/client.c
parent34824cf6f98cd623b0368e4dbc9eaf65110572d1 (diff)
parent8ea939e19d5f50d020e33a08237105a96ed4ae30 (diff)
downloadlibdbusmenu-ddd09f68a4d3e991b3db7a1f1a67408bba4875e4.tar.gz
libdbusmenu-ddd09f68a4d3e991b3db7a1f1a67408bba4875e4.tar.bz2
libdbusmenu-ddd09f68a4d3e991b3db7a1f1a67408bba4875e4.zip
Fix the event signal and add a test for it.
Diffstat (limited to 'libdbusmenu-glib/client.c')
-rw-r--r--libdbusmenu-glib/client.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 43bde5f..ca16c9a 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1058,10 +1058,10 @@ menuitem_call_cb (DBusGProxy * proxy, GError * error, gpointer userdata)
event_data_t * edata = (event_data_t *)userdata;
if (error != NULL) {
- g_warning("Unable to call menu item %d: %s", GPOINTER_TO_INT(userdata), error->message);
+ g_warning("Unable to call event '%s' on menu item %d: %s", edata->event, dbusmenu_menuitem_get_id(edata->menuitem), error->message);
}
- g_signal_emit(edata->client, signals[EVENT_RESULT], 0, edata->menuitem, edata->event, edata->data, edata->timestamp, error, TRUE);
+ g_signal_emit(edata->client, signals[EVENT_RESULT], 0, edata->menuitem, edata->event, &edata->data, edata->timestamp, error, TRUE);
g_value_unset(&edata->data);
g_free(edata->event);
@@ -1103,7 +1103,12 @@ dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name
g_value_copy(value, &edata->data);
edata->timestamp = timestamp;
- org_ayatana_dbusmenu_event_async (priv->menuproxy, id, name, value, timestamp, menuitem_call_cb, edata);
+ DBusGAsyncData *stuff;
+ stuff = g_slice_new (DBusGAsyncData);
+ stuff->cb = G_CALLBACK (menuitem_call_cb);
+ stuff->userdata = edata;
+ dbus_g_proxy_begin_call_with_timeout (priv->menuproxy, "Event", org_ayatana_dbusmenu_event_async_callback, stuff, _dbus_glib_async_data_free, 1000, G_TYPE_INT, id, G_TYPE_STRING, name, G_TYPE_VALUE, value, G_TYPE_UINT, timestamp, G_TYPE_INVALID);
+
return;
}