diff options
author | Ted Gould <ted@canonical.com> | 2009-10-07 12:56:05 -0400 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-10-07 12:56:05 -0400 |
commit | 1b12089eb7897608478ce4c3ab9b58361cbe991f (patch) | |
tree | da57310060216d3a0a468b5943d70e066f4bfa01 /src | |
parent | 22a02f891220f637ec1b451b517f25b69cbe8b01 (diff) | |
download | ayatana-indicator-session-1b12089eb7897608478ce4c3ab9b58361cbe991f.tar.gz ayatana-indicator-session-1b12089eb7897608478ce4c3ab9b58361cbe991f.tar.bz2 ayatana-indicator-session-1b12089eb7897608478ce4c3ab9b58361cbe991f.zip |
Switching the sleep action to have a response so we can make sure to unthrottle the screensaver.
Diffstat (limited to 'src')
-rw-r--r-- | src/session-service.c | 19 |
1 files changed, 15 insertions, 4 deletions
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; } |