Skip to content

screensaver: emit ActiveChanged on lock/unlock#1761

Merged
bbedward merged 1 commit intoAvengeMedia:masterfrom
xPathin:fix/screensaver-activechanged-signal
Feb 20, 2026
Merged

screensaver: emit ActiveChanged on lock/unlock#1761
bbedward merged 1 commit intoAvengeMedia:masterfrom
xPathin:fix/screensaver-activechanged-signal

Conversation

@xPathin
Copy link
Copy Markdown
Contributor

@xPathin xPathin commented Feb 20, 2026

Closes #1760

Summary

  • Bridge loginctl lock state to the screensaver module so ActiveChanged(bool) gets emitted on the session bus when the screen locks/unlocks
  • Claim both org.freedesktop.ScreenSaver and org.gnome.ScreenSaver independently -- if one is already taken by the compositor, the other still works
  • Add GetActive/SetActive/Lock methods to the screensaver D-Bus interface
  • Fix Close() not cleaning up screensaver subscriber channels

Context

Apps like Bitwarden listen for ActiveChanged on org.freedesktop.ScreenSaver / org.gnome.ScreenSaver to detect screen lock. The screensaver module only handled idle inhibition and had no lock state awareness, so these apps never saw lock events.

The old code also bailed out entirely if org.freedesktop.ScreenSaver was already owned by another process, which left the whole module dead on compositors that claim that name for idle inhibiting.

Now both names are claimed independently and a bridge goroutine subscribes to loginctl state changes to forward lock/unlock events as ActiveChanged signals on the session bus.

Test plan

  • make fmt / make test pass
  • GetActive responds on the session bus
  • ActiveChanged(true) emitted on lock
  • ActiveChanged(false) emitted on unlock
  • Bitwarden "On system lock" vault timeout works
  • Reverted to old binary to confirm it was broken before

@bbedward bbedward merged commit 8ad0cf8 into AvengeMedia:master Feb 20, 2026
2 checks passed
@xPathin xPathin deleted the fix/screensaver-activechanged-signal branch February 21, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bitwarden "On system lock" vault timeout doesn't work

2 participants