diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | mate-session/gsm-manager.c | 24 |
2 files changed, 7 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac index ff0ea31..31beb61 100644 --- a/configure.ac +++ b/configure.ac @@ -153,7 +153,7 @@ if test "x$enable_upower" = "xyes"; then fi PKG_CHECK_MODULES([UPOWER_HIBERNATE], [upower-glib < 0.99], has_upower_hibernate_suspend=yes, has_upower_hibernate_suspend=no) if test "x$has_upower_hibernate_suspend" = "xyes"; then - AC_DEFINE(HAVE_UPOWER_HIBERNATE_SUSPEND, 1, [upower based support for hibernate and suspend (<0.99) ]) + AC_DEFINE(HAVE_UPOWER_HIBERNATE_SUSPEND, 1, [upower based support for hibernate and suspend (< 0.99)]) fi fi diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c index 7930993..a0e1762 100644 --- a/mate-session/gsm-manager.c +++ b/mate-session/gsm-manager.c @@ -1166,11 +1166,6 @@ manager_perhaps_lock (GsmManager *manager) static void manager_attempt_hibernate (GsmManager *manager) { -#ifdef HAVE_UPOWER - gboolean can_hibernate; - GError *error; - gboolean ret; -#endif #ifdef HAVE_SYSTEMD if (LOGIND_RUNNING()) { @@ -1188,14 +1183,13 @@ manager_attempt_hibernate (GsmManager *manager) else { #endif #ifdef HAVE_UPOWER_HIBERNATE_SUSPEND - can_hibernate = up_client_get_can_hibernate (manager->priv->up_client); + gboolean can_hibernate = up_client_get_can_hibernate (manager->priv->up_client); if (can_hibernate) { - /* lock the screen before we suspend */ manager_perhaps_lock (manager); - error = NULL; - ret = up_client_hibernate_sync (manager->priv->up_client, NULL, &error); + GError *error = NULL; + gboolean ret = up_client_hibernate_sync (manager->priv->up_client, NULL, &error); if (!ret) { g_warning ("Unexpected hibernate failure: %s", error->message); @@ -1211,11 +1205,6 @@ manager_attempt_hibernate (GsmManager *manager) static void manager_attempt_suspend (GsmManager *manager) { -#ifdef HAVE_UPOWER - gboolean can_suspend; - GError *error; - gboolean ret; -#endif #ifdef HAVE_SYSTEMD if (LOGIND_RUNNING()) { @@ -1233,14 +1222,13 @@ manager_attempt_suspend (GsmManager *manager) else { #endif #ifdef HAVE_UPOWER_HIBERNATE_SUSPEND - can_suspend = up_client_get_can_suspend (manager->priv->up_client); + gboolean can_suspend = up_client_get_can_suspend (manager->priv->up_client); if (can_suspend) { - /* lock the screen before we suspend */ manager_perhaps_lock (manager); - error = NULL; - ret = up_client_suspend_sync (manager->priv->up_client, NULL, &error); + GError *error = NULL; + gboolean ret = up_client_suspend_sync (manager->priv->up_client, NULL, &error); if (!ret) { g_warning ("Unexpected suspend failure: %s", error->message); |