re-acquire session lock on startup if logind reports session locked
This commit is contained in:
parent
3c9bf06bf7
commit
f071bb17e1
1 changed files with 18 additions and 1 deletions
|
|
@ -40,8 +40,10 @@ Scope {
|
||||||
}
|
}
|
||||||
|
|
||||||
onExited: {
|
onExited: {
|
||||||
if (root._sessionPath)
|
if (root._sessionPath) {
|
||||||
_logindMonitor.running = true;
|
_logindMonitor.running = true;
|
||||||
|
_lockStateCheck.running = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,6 +64,21 @@ Scope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set logind LockedHint when lock state changes
|
// Set logind LockedHint when lock state changes
|
||||||
Process {
|
Process {
|
||||||
id: _lockedHint
|
id: _lockedHint
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue