utils/gatelock/gatelock
Krzysztof kuhy Rudnicki 92f55cee5a
Some checks failed
gatelock pre-commit / pre-commit (push) Has been cancelled
gatelock tests / test (3.10) (push) Has been cancelled
gatelock tests / test (3.11) (push) Has been cancelled
gatelock tests / test (3.12) (push) Has been cancelled
gatelock 0.4.1: re-focus a surface that comes back after a blip
LockWindow.grab_input() only ever focuses the entry once, on first grab
acquisition (_notify_focus_ready is one-shot). A surface torn down and
rebuilt later -- a monitor going dark and recovering, which flaky DDC/CI
power control does routinely -- gets a brand new widget that nothing
ever focuses. The grab stays held, so no other window can take focus
either: the entry renders correctly but is permanently keyboard-dead
until the process restarts.

RecoveryLoop.tick() now re-runs the same focus_surface(preferred_focus_
index()) call whenever a tick's surface delta reports a newly created
output, mirroring what LockWindow does on first acquisition. Bundled the
loop's five collaborators into a RecoveryCollaborators dataclass rather
than growing its constructor past ruff's five-argument limit.

Diagnosed against a week of wake-alarm's real journal history: the
dismiss-code box rendered normally every alarm morning but accepted no
keystrokes, tracking exactly with HDMI-0's recorded dark/recover blips
near 07:00 and 07:55 each day.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NGAEbavLSCAotBqhVfFhPc
2026-08-12 22:13:46 +02:00
..
tests gatelock 0.4.1: re-focus a surface that comes back after a blip 2026-08-12 22:13:46 +02:00
__init__.py gatelock 0.4.0: the viewport moves for the user and nobody else 2026-08-03 15:50:51 +02:00
_arbiter.py gatelock v0.2.0: per-output locking, monotonic recovery, N-app arbitration 2026-07-25 14:30:03 +02:00
_density.py gatelock 0.4.0: the viewport moves for the user and nobody else 2026-08-03 15:50:51 +02:00
_detect.py gatelock v0.2.0: per-output locking, monotonic recovery, N-app arbitration 2026-07-25 14:30:03 +02:00
_escape.py gatelock: extract the shared escape-hatch core 2026-07-25 15:35:20 +02:00
_fitcheck.py gatelock 0.4.0: the viewport moves for the user and nobody else 2026-08-03 15:50:51 +02:00
_guards.py gatelock v0.2.0: per-output locking, monotonic recovery, N-app arbitration 2026-07-25 14:30:03 +02:00
_keyboard.py Make lock surfaces keyboard-operable and safe on a 768px screen 2026-07-30 16:01:15 +02:00
_outputs.py gatelock v0.2.0: per-output locking, monotonic recovery, N-app arbitration 2026-07-25 14:30:03 +02:00
_recovery.py gatelock 0.4.1: re-focus a surface that comes back after a blip 2026-08-12 22:13:46 +02:00
_root.py Initial gatelock: shared lock-window + HMAC log-integrity backend 2026-06-19 17:39:44 +02:00
_scrollable.py gatelock 0.4.0: the viewport moves for the user and nobody else 2026-08-03 15:50:51 +02:00
_surfaces.py gatelock v0.2.0: per-output locking, monotonic recovery, N-app arbitration 2026-07-25 14:30:03 +02:00
_vt.py Initial gatelock: shared lock-window + HMAC log-integrity backend 2026-06-19 17:39:44 +02:00
_window.py gatelock 0.4.1: re-focus a surface that comes back after a blip 2026-08-12 22:13:46 +02:00
log_integrity.py Initial gatelock: shared lock-window + HMAC log-integrity backend 2026-06-19 17:39:44 +02:00