From 72f52f7f170e28a87ed58436d438aa1bea2ecf11 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 27 Aug 2010 15:20:48 -0500 Subject: Setting default timeout to 2 seconds. We need to be responsive. --- libdbusmenu-glib/client.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libdbusmenu-glib/client.c') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 43bde5f..7051e96 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -876,6 +876,7 @@ build_proxies (DbusmenuClient * client) } g_object_add_weak_pointer(G_OBJECT(priv->menuproxy), (gpointer *)&priv->menuproxy); g_signal_connect(G_OBJECT(priv->menuproxy), "destroy", G_CALLBACK(proxy_destroyed), client); + dbus_g_proxy_set_default_timeout(priv->menuproxy, 2000); /* If we get here, we don't need the DBus proxy */ if (priv->dbusproxy != NULL) { -- cgit v1.2.3 From 0b3dc82b5f2885d7ef3dca837f7fa02b0e73012b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 27 Aug 2010 16:13:59 -0500 Subject: Fixing the parameter type --- libdbusmenu-glib/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib/client.c') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 7051e96..3f06618 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1059,10 +1059,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); -- cgit v1.2.3 From 8ea939e19d5f50d020e33a08237105a96ed4ae30 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 27 Aug 2010 17:01:01 -0500 Subject: Instead of setting the default timeout, we're copying the generated code to set a custom timeout for the event signal --- libdbusmenu-glib/client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-glib/client.c') diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 3f06618..ca16c9a 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -876,7 +876,6 @@ build_proxies (DbusmenuClient * client) } g_object_add_weak_pointer(G_OBJECT(priv->menuproxy), (gpointer *)&priv->menuproxy); g_signal_connect(G_OBJECT(priv->menuproxy), "destroy", G_CALLBACK(proxy_destroyed), client); - dbus_g_proxy_set_default_timeout(priv->menuproxy, 2000); /* If we get here, we don't need the DBus proxy */ if (priv->dbusproxy != NULL) { @@ -1104,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; } -- cgit v1.2.3