summaryrefslogtreecommitdiff
path: root/mate-session/gsm-manager.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2013-09-12 17:42:23 +0200
committerraveit65 <[email protected]>2013-09-12 17:42:23 +0200
commitf0b5b1ab78879d64f80117415aacf029359afea5 (patch)
treef5aad4ebb742f341bf248aa8a1e554cdfd3b7401 /mate-session/gsm-manager.c
parentf37bbe895ebe09cfa468884973aca490e7a6785e (diff)
downloadmate-session-manager-f0b5b1ab78879d64f80117415aacf029359afea5.tar.bz2
mate-session-manager-f0b5b1ab78879d64f80117415aacf029359afea5.tar.xz
fix systemd-login1 support for hibernate/suspend
Diffstat (limited to 'mate-session/gsm-manager.c')
-rw-r--r--mate-session/gsm-manager.c34
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