summaryrefslogtreecommitdiff
path: root/src/up-daemon.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2010-05-07 20:38:46 +0100
committerRichard Hughes <richard@hughsie.com>2010-05-07 20:38:46 +0100
commit43fd837e00860727a153eaf9e6ef7eb795319302 (patch)
treeafad36b25bc321ae2f6ba5684cf9d20fc2ba5be2 /src/up-daemon.c
parent07a404840eec8718893ddf91755046e6687d8547 (diff)
downloadupower-43fd837e00860727a153eaf9e6ef7eb795319302.tar.gz
Only emit ::Sleeping() after we've checked AboutToSleep()
Diffstat (limited to 'src/up-daemon.c')
-rw-r--r--src/up-daemon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c
index 33c400d..77ae399 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -313,10 +313,6 @@ up_daemon_about_to_sleep (UpDaemon *daemon, DBusGMethodInvocation *context)
GError *error;
UpDaemonPrivate *priv = daemon->priv;
- egg_debug ("emitting sleeping");
- g_signal_emit (daemon, signals[SIGNAL_SLEEPING], 0);
- g_timer_start (priv->about_to_sleep_timer);
-
/* already requested */
if (priv->about_to_sleep_id != 0) {
error = g_error_new (UP_DAEMON_ERROR,
@@ -334,6 +330,10 @@ up_daemon_about_to_sleep (UpDaemon *daemon, DBusGMethodInvocation *context)
if (!up_polkit_check_auth (priv->polkit, subject, "org.freedesktop.upower.suspend", context))
goto out;
+ egg_debug ("emitting sleeping");
+ g_signal_emit (daemon, signals[SIGNAL_SLEEPING], 0);
+ g_timer_start (priv->about_to_sleep_timer);
+
dbus_g_method_return (context, NULL);
out:
if (subject != NULL)