fix lock binding loops caused by id/property name shadowing

This commit is contained in:
Damocles 2026-04-17 15:44:09 +02:00
parent e8a7469d47
commit d58d4b0078

View file

@ -11,17 +11,17 @@ Scope {
property string _sessionPath: ""
WlSessionLock {
id: lock
id: _lock
LockSurface {
lock: lock
auth: auth
lock: _lock
auth: _auth
}
}
LockAuth {
id: auth
lock: lock
id: _auth
lock: _lock
}
// Resolve the actual logind session object path at startup
@ -55,7 +55,7 @@ Scope {
stdout: SplitParser {
onRead: data => {
if (data.indexOf(".Lock ()") !== -1 && root._enabled)
lock.locked = true;
_lock.locked = true;
// Unlock is PAM-driven, ignore logind Unlock signal
}
}
@ -64,11 +64,11 @@ Scope {
// Set logind LockedHint when lock state changes
Process {
id: _lockedHint
command: ["busctl", "call", "--system", "org.freedesktop.login1", root._sessionPath || "/org/freedesktop/login1/session/auto", "org.freedesktop.login1.Session", "SetLockedHint", "b", lock.locked ? "true" : "false"]
command: ["busctl", "call", "--system", "org.freedesktop.login1", root._sessionPath || "/org/freedesktop/login1/session/auto", "org.freedesktop.login1.Session", "SetLockedHint", "b", _lock.locked ? "true" : "false"]
}
Connections {
target: lock
target: _lock
function onLockStateChanged() {
if (root._sessionPath)