Optionally lock the session when the last client disconnects

Adds a LockOnDisconnect setting, exposed in the KCM, that locks the desktop via logind as the last RDP client disconnects and unlocks it when a client connects. Off by default, a no-op unless enabled.

The session is resolved from $XDG_SESSION_ID (falling back to the process's PID, since krdpserver is a user-service process rather than a login-session process) and locked/unlocked through org.freedesktop.login1, which kscreenlocker already honours. Everything runs asynchronously over QDBusConnection, a slow or hung logind must not stall the GUI thread that also drives PipeWire/input/video for every other connected client.

Unlocking is gated on the connection reaching Activated/Streaming, not on TCP accept, since logind Unlock is passwordless and unlocking at accept would let anyone able to open the port unlock the physical seat before authentication.

Edited by Nick Haghiri

Merge request reports

Loading