screen-locker/stronglift_replacement/workout_app/linux/runner
Krzysztof kuhy Rudnicki 4d1d2ea64d Put the demo's escape hatch inside the app, the only place it can be received
Both previous escapes were unreachable, for the same underlying reason stated
two different ways. A Tk key binding cannot fire, because once the workout app
takes its seat grab X delivers every keystroke to that app alone. And "run
touch from another terminal" cannot be done, because the app covers the screen
with an override-redirect fullscreen window -- there is no other terminal to
reach. An escape has to be handled INSIDE the grab, by the app itself, or it
is not an escape.

So --demo-escape arms a key handler in the runner: Ctrl+Shift+Q ungrabs the
seat and closes the window. The grab, the override-redirect window and the
handoff are all unchanged, so the demo exercises the real locking mechanism
rather than a softened copy of it, and the hatch is the one deliberate way
out.

The handler ungrabs before closing. Destroying a window that still holds the
seat can leave the pointer and keyboard grabbed with nothing left to release
them, which needs exactly the reboot this hatch exists to prevent.

Not Escape, which the Dart side already binds for in-app navigation; shadowing
it would change the behaviour under test.

Verified in both directions against the real debug bundle, each under its own
Xvfb display: with the flag, the app exits on Ctrl+Shift+Q while holding the
grab and the lock takes the screen back; without it, the identical keystroke
does nothing and the app keeps the screen. A test asserts the production path
never passes the flag.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DfJC1Wu1SEgJ6X49k5Jqtg
2026-08-22 12:41:07 +02:00
..
CMakeLists.txt Put the demo's escape hatch inside the app, the only place it can be received 2026-08-22 12:41:07 +02:00
demo_escape.cc Put the demo's escape hatch inside the app, the only place it can be received 2026-08-22 12:41:07 +02:00
demo_escape.h Put the demo's escape hatch inside the app, the only place it can be received 2026-08-22 12:41:07 +02:00
main.cc Run the workout app on Linux, and let it hold the screen lock 2026-08-22 11:18:48 +02:00
my_application.cc Put the demo's escape hatch inside the app, the only place it can be received 2026-08-22 12:41:07 +02:00
my_application.h Run the workout app on Linux, and let it hold the screen lock 2026-08-22 11:18:48 +02:00