mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-19 23:38:12 +02:00
Only emit ::Sleeping() after we've checked AboutToSleep()
This commit is contained in:
parent
07a404840e
commit
43fd837e00
1 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue