diff options
Diffstat (limited to 'mate-session/gsm-manager.c')
-rw-r--r-- | mate-session/gsm-manager.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c index 8143d1f..b4986ac 100644 --- a/mate-session/gsm-manager.c +++ b/mate-session/gsm-manager.c @@ -1109,6 +1109,20 @@ manager_attempt_hibernate (GsmManager *manager) GError *error; gboolean ret; +#ifdef HAVE_SYSTEMD + if (LOGIND_RUNNING()) { + + GsmSystemd *systemd; + + systemd = gsm_get_systemd (); + + /* lock the screen before we suspend */ + manager_perhaps_lock (manager); + + gsm_systemd_attempt_hibernate (systemd); + } + else { +#endif can_hibernate = up_client_get_can_hibernate (manager->priv->up_client); if (can_hibernate) { @@ -1123,6 +1137,9 @@ manager_attempt_hibernate (GsmManager *manager) g_error_free (error); } } +#ifdef HAVE_SYSTEMD + } +#endif } static void @@ -1132,6 +1149,20 @@ manager_attempt_suspend (GsmManager *manager) GError *error; gboolean ret; +#ifdef HAVE_SYSTEMD + if (LOGIND_RUNNING()) { + + GsmSystemd *systemd; + + systemd = gsm_get_systemd (); + + /* lock the screen before we suspend */ + manager_perhaps_lock (manager); + + gsm_systemd_attempt_suspend (systemd); + } + else { +#endif can_suspend = up_client_get_can_suspend (manager->priv->up_client); if (can_suspend) { @@ -1146,6 +1177,9 @@ manager_attempt_suspend (GsmManager *manager) g_error_free (error); } } +#ifdef HAVE_SYSTEMD + } +#endif } static void |