Repository navigation
feat(session): lock/blank awareness (issue #160) - #164
Merged
Merged
Conversation
… (GNOME) Two-state session screen awareness (issue #160): `locked` (login1 LockedHint) drives a daemon-side refusal of focus-targeting input and a full lock takeover on the client; `blanked` (org.gnome.ScreenSaver) drives only a soft wake banner and keeps presses enabled so a press wakes the machine. - protocol: StateMessage gains `blanked`; pushed on transitions and replayed in the connect snapshot (capability-gated — a backend that can't observe never produces a frame, so no client strands). - platform: GnomeShellFocusBackend.watch_session_state polls both halves; base backend refuses and does not advertise session_lock / session_blank; KDE deliberately not inherited (follow-up). - server: gate in _dispatch_press and key/type/pad/jog paths beside the _injection_blocked precedent (lock_dropped outcome + ErrorMessage reason screen_locked); --allow-while-locked opt-out. - client: rename auth label to "sign-in needed" (naming collision); lock takeover with host-named copy, connection dot stays green, app badge reads "Screen locked"; running-programs button disabled with the lock-specific windows-empty slot; now playing / settings / editor stay gated-off the takeover (still usable). - docs/tests: capability matrix rows for both flags, _AXIS-guarded; CONTEXT.md language; tests/test_session_lock.py. Closes #160
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements two-state session screen awareness (issue #160). When the desktop session locks, the phone swaps to a lock takeover and the daemon refuses focus-targeting input (presses, key/type injection, trackpad, window raising). When the screen blanks without locking, a soft "wake me" banner appears but input stays enabled—the first tap wakes the machine.
Changes
Protocol & Core
StateMessagenow carries two independent booleans:locked(credentials required) andblanked(screen off), not a single conflated state. This split is critical—blanking alone can't gate input, else a plain screen blank forfeits "wake from phone" entirely.--allow-while-lockedopt-out flag for setups that want ungated remote control behind the shield (e.g., scripted kiosks).Client (React)
locked=true. Shows lock icon, "Screen locked" title, and host name. Keeps the connection dot green (socket is fine).blanked=trueandlocked=false. Input deliberately stays enabled.Daemon (Python)
session_lockandsession_blankcapabilities. Probes both halves independently vialogin1sessionLockedHintandorg.gnome.ScreenSaver.GetActive.watch_session_state()polls every 2 seconds (slow cadence by design—lock transitions matter at conversation speed).errorframe with reasonscreen_lockedso a client that missed the transition still surfaces something real.lock_droppedoutcome in recent-actions and diagnostics.Testing
tests/test_session_lock.py: 20+ tests covering backend detection, transition polling, connect snapshot, input gating, and opt-out behavior.Documentation
CONTEXT.md,PLATFORM-PARITY.md,REFERENCE.md, andREADME.mdwith session-state terminology and capability matrix.Design Decisions
--allow-while-lockedfor kiosks that need ungated remote control.stateframe; the client's default (all-false) is honest.