lock: use direct Scope instead of LazyLoader, gate on module enable

This commit is contained in:
Damocles 2026-04-17 13:53:49 +02:00
parent fcbb54949f
commit fec5ef4d76
2 changed files with 5 additions and 6 deletions

View file

@ -7,6 +7,8 @@ import ".." as M
Scope {
id: root
readonly property bool _enabled: M.Modules.lock.enable
WlSessionLock {
id: lock
@ -26,13 +28,13 @@ Scope {
Process {
id: _logindMonitor
command: ["busctl", "monitor", "--system", "--match", "type='signal',interface='org.freedesktop.login1.Session',member='Lock'", "--match", "type='signal',interface='org.freedesktop.login1.Session',member='Unlock'", "--json=short"]
running: true
running: root._enabled
stdout: SplitParser {
onRead: data => {
try {
const msg = JSON.parse(data);
if (msg.member === "Lock")
if (msg.member === "Lock" && root._enabled)
lock.locked = true;
// Unlock is PAM-driven, ignore logind Unlock signal
} catch (e) {}