|
|
ab48da |
From bda1257c8299045fa4d4aa09e05f70e404cacc56 Mon Sep 17 00:00:00 2001
|
|
|
ab48da |
From: Victor Toso <victortoso@redhat.com>
|
|
|
ab48da |
Date: Thu, 12 May 2016 09:25:49 +0200
|
|
|
ab48da |
Subject: [PATCH] ScreenShield: set LockedHint property from systemd
|
|
|
ab48da |
|
|
|
ab48da |
Logind recently got support for a hint property in Session Object to
|
|
|
ab48da |
inform if session is Locked or not. It is up to desktop environments
|
|
|
ab48da |
to keep this property up to date.
|
|
|
ab48da |
|
|
|
ab48da |
https://bugzilla.gnome.org/show_bug.cgi?id=764773
|
|
|
ab48da |
---
|
|
|
ab48da |
js/misc/loginManager.js | 3 +++
|
|
|
ab48da |
js/ui/screenShield.js | 10 +++++++++-
|
|
|
ab48da |
2 files changed, 12 insertions(+), 1 deletion(-)
|
|
|
ab48da |
|
|
|
ab48da |
diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js
|
|
|
ab48da |
index b4ed4a6..af0586e 100644
|
|
|
ab48da |
--- a/js/misc/loginManager.js
|
|
|
ab48da |
+++ b/js/misc/loginManager.js
|
|
|
ab48da |
@@ -40,6 +40,9 @@ const SystemdLoginSessionIface = '<node> \
|
|
|
ab48da |
<signal name="Lock" /> \
|
|
|
ab48da |
<signal name="Unlock" /> \
|
|
|
ab48da |
<property name="Active" type="b" access="read" /> \
|
|
|
ab48da |
+<method name="SetLockedHint"> \
|
|
|
ab48da |
+ <arg type="b" direction="in"/> \
|
|
|
ab48da |
+</method> \
|
|
|
ab48da |
</interface> \
|
|
|
ab48da |
</node>';
|
|
|
ab48da |
|
|
|
ab48da |
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
|
|
|
ab48da |
index 3a84468..973604a 100644
|
|
|
ab48da |
--- a/js/ui/screenShield.js
|
|
|
ab48da |
+++ b/js/ui/screenShield.js
|
|
|
ab48da |
@@ -1125,9 +1125,13 @@ const ScreenShield = new Lang.Class({
|
|
|
ab48da |
let prevIsActive = this._isActive;
|
|
|
ab48da |
this._isActive = true;
|
|
|
ab48da |
|
|
|
ab48da |
- if (prevIsActive != this._isActive)
|
|
|
ab48da |
+ if (prevIsActive != this._isActive) {
|
|
|
ab48da |
this.emit('active-changed');
|
|
|
ab48da |
|
|
|
ab48da |
+ if (this._loginSession)
|
|
|
ab48da |
+ this._loginSession.SetLockedHintRemote(this._isActive);
|
|
|
ab48da |
+ }
|
|
|
ab48da |
+
|
|
|
ab48da |
if (this._aboutToSuspend)
|
|
|
ab48da |
this._uninhibitSuspend();
|
|
|
ab48da |
|
|
|
ab48da |
@@ -1226,6 +1230,8 @@ const ScreenShield = new Lang.Class({
|
|
|
ab48da |
this._activationTime = 0;
|
|
|
ab48da |
this._isActive = false;
|
|
|
ab48da |
this.emit('active-changed');
|
|
|
ab48da |
+ if (this._loginSession)
|
|
|
ab48da |
+ this._loginSession.SetLockedHintRemote(this._isActive);
|
|
|
ab48da |
return;
|
|
|
ab48da |
}
|
|
|
ab48da |
|
|
|
ab48da |
@@ -1272,6 +1278,8 @@ const ScreenShield = new Lang.Class({
|
|
|
ab48da |
this._isLocked = false;
|
|
|
ab48da |
this.emit('active-changed');
|
|
|
ab48da |
this.emit('locked-changed');
|
|
|
ab48da |
+ if (this._loginSession)
|
|
|
ab48da |
+ this._loginSession.SetLockedHintRemote(this._isActive);
|
|
|
ab48da |
global.set_runtime_state(LOCKED_STATE_STR, null);
|
|
|
ab48da |
},
|
|
|
ab48da |
|
|
|
ab48da |
--
|
|
|
ab48da |
2.7.4
|
|
|
ab48da |
|