From 1b12089eb7897608478ce4c3ab9b58361cbe991f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 7 Oct 2009 12:56:05 -0400 Subject: Switching the sleep action to have a response so we can make sure to unthrottle the screensaver. --- src/session-service.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/session-service.c b/src/session-service.c index 3c0535f..a4240be 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -55,6 +55,14 @@ static DbusmenuMenuitem * logout_mi = NULL; static DbusmenuMenuitem * restart_mi = NULL; static DbusmenuMenuitem * shutdown_mi = NULL; +/* A return from the command to sleep the system. Make sure + that we unthrottle the screensaver. */ +static void +sleep_response (DBusGProxy * proxy, DBusGProxyCall * call, gpointer data) +{ + screensaver_unthrottle(); + return; +} /* Let's put this machine to sleep, with some info on how it should sleep. */ @@ -67,12 +75,15 @@ sleep (DbusmenuMenuitem * mi, gpointer userdata) g_warning("Can not %s as no DeviceKit Power Proxy", type); } + screensaver_throttle(type); lock_screen(NULL, NULL); - dbus_g_proxy_call_no_reply(dkp_main_proxy, - type, - G_TYPE_INVALID, - G_TYPE_INVALID); + dbus_g_proxy_begin_call(dkp_main_proxy, + type, + sleep_response, + NULL, + NULL, + G_TYPE_INVALID); return; } -- cgit v1.2.3