Watch
1
0
Fork
You've already forked souveraine
0

shell: resolve logind session via User.Display, re-register after sessiond restart

SessionEvents asked loginctl for -p ObjectPath, which is not a property — it
returned empty on every boot, so external lock signals were never monitored and
the shell had no unlock ingress. Resolve the graphical session the way
lockhint.rs does; not GetSession(auto) (this shell is a session-less user unit)
and not the /session/auto alias (PropertiesChanged only fires on the concrete
path).

SessiondBridge read root.registered to decide whether to re-register on
reconnect, but the disconnect branch had already cleared it, so the shell never
re-registered after a sessiond restart. Latch it.
This commit is contained in:
Fimeg 2026-07-27 21:21:26 -04:00
commit 4ed8f3dd74
2 changed files with 33 additions and 22 deletions

View file

@ -28,6 +28,10 @@ Singleton {
// Registered = shell_ready was answered ok on the CURRENT connection.
property bool registered: false
// Latched copy of `registered` taken when the connection drops. The
// disconnect branch clears `registered` before the reconnect branch runs,
// so reconnect cannot read it directly to decide whether to re-register.
property bool wasRegistered: false
// sessiond held the session lock when we registered; we owe it a lock
// and a locked_ack.
property bool oweLock: false
@ -112,8 +116,9 @@ Singleton {
onConnectionStateChanged: {
if (sock.connected) {
console.log("[sessiond-bridge] connected");
const wasRegistered = root.registered;
const wasRegistered = root.wasRegistered;
root.registered = false;
root.wasRegistered = false;
root.ackSent = false;
if (wasRegistered) {
root.shellReady(function(mustLock) {
@ -126,6 +131,7 @@ Singleton {
}
} else {
console.log("[sessiond-bridge] disconnected");
root.wasRegistered = root.registered;
root.registered = false;
root.pendingReady = null;
}