Compare commits
1 changed files with 2 additions and 20 deletions
|
|
@ -40,10 +40,8 @@ Scope {
|
||||||
}
|
}
|
||||||
|
|
||||||
onExited: {
|
onExited: {
|
||||||
if (root._sessionPath) {
|
if (root._sessionPath)
|
||||||
_logindMonitor.running = true;
|
_logindMonitor.running = true;
|
||||||
_lockStateCheck.running = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,23 +56,7 @@ Scope {
|
||||||
onRead: data => {
|
onRead: data => {
|
||||||
if (data.indexOf(".Lock ()") !== -1 && root._enabled)
|
if (data.indexOf(".Lock ()") !== -1 && root._enabled)
|
||||||
_lock.locked = true;
|
_lock.locked = true;
|
||||||
else if (data.indexOf(".Unlock ()") !== -1 && _lock.locked)
|
// Unlock is PAM-driven, ignore logind Unlock signal
|
||||||
_lock.locked = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if session is already locked on startup (crash recovery)
|
|
||||||
Process {
|
|
||||||
id: _lockStateCheck
|
|
||||||
running: false
|
|
||||||
command: ["busctl", "get-property", "--system", "org.freedesktop.login1", root._sessionPath, "org.freedesktop.login1.Session", "LockedHint"]
|
|
||||||
|
|
||||||
stdout: SplitParser {
|
|
||||||
onRead: data => {
|
|
||||||
// Output: b true/false
|
|
||||||
if (data.indexOf("true") !== -1 && root._enabled && !_lock.locked)
|
|
||||||
_lock.locked = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue