Harden touch device recovery and input lifecycle

This commit is contained in:
Storm Dragon committed 2026-11-24 19:17:26 -05:00
1 parent e4ba4d9882
commit 03066b2abe
16 files changed
+323 -66

No files matched your search

+41 -3
View File
@@ -5,7 +5,7 @@ only input, the way TalkBack, VoiceOver and NVDA touch work. Touch is its own
subsystem with its own gestures, bindings and modes. It shares only the
"what is at this point" hit test with mouse review.
Branch: `touch-support`, based on `testing`. Requested by Storm Dragon.
Integrated into `testing` from Chase Cichorz's three-commit touch patch.
## Design
@@ -138,10 +138,10 @@ test stopped. Chromium stopped at tables, so cells were never reached.
## Testing
- Automated: `dbus-run-session -- go test ./internal/touch ./internal/platform/evdev ./internal/i3command ./internal/review ./internal/app ./internal/config ./internal/preferences ./internal/platform/xorg -count=1`.
- Automated: `python3 tests/native_test_session.py go test ./internal/touch ./internal/platform/evdev ./internal/i3command ./internal/review ./internal/app ./internal/config ./internal/preferences ./internal/platform/xorg -count=1`.
`internal/app` tests read the real session bus, so run them under
`dbus-run-session` or they fail while a screen lock is active.
- Native X11: `CTHULHU_NATIVE_X11=1 xvfb-run -a -s "-screen 0 1280x800x24" go test ./internal/platform/xorg -run TestNativeWindowLocator`
- Native X11: `python3 tests/native_test_session.py env CTHULHU_NATIVE_X11=1 go test ./internal/platform/xorg -run "TestNativeWindowLocator|TestNativeTouchKey" -count=1`
(needs xterm, xdotool and xprop). Real touch device discovery:
`CTHULHU_NATIVE_EVDEV=1 go test ./internal/platform/evdev -run TestNativeFindTouchScreens`.
- Live: run `build/cthulhu --replace --config <copy of your settings> --debug-file <log>`
@@ -223,3 +223,41 @@ test stopped. Chromium stopped at tables, so cells were never reached.
- 2026-11-24: MATE testing: the 24 pixel panels were too thin to find by
touch (the tester's MATE panels were raised to 64). Explore now says
"Blank" over empty space and names the window a finger crosses into.
## Integration review and acceptance
The integration fixes device retry starvation; uses scalar EVIOCGRAB arguments
for acquisition and release; decodes native input-event sizes and byte order;
rejects unsupported descriptors and slots; and cancels lost input instead of
turning it into a tap. After overflow the service releases and reopens the
device after five seconds to discard unknown slot state. Disable, lock and
device loss clear the activation point and retire pending exploration results.
Wayland sessions never grab a device. Synthesized keys preserve keys already
held by the user. Item traversal has an explicit ascent limit. Empty i3 replies
are failures and cancellation closes an outstanding command connection.
Before pushing, build from testing and check on the touchscreen:
1. Toggle with Cthulhu+Ctrl+Alt+T; explore, tap, double tap, rotate, and flick
through each mode. Check speech and Braille, including window boundaries.
2. Unplug/reconnect or enable before connecting the device. It should become
available after the retry interval. Toggle off/on; a double tap must not
activate an old point. Lock/unlock using the keyboard and repeat.
3. Hold either physical Shift while issuing touch Shift+Tab. Shift must remain
held until physically released; normal keyboard navigation must still work.
4. Check mouse review, GTK notebook pages, browser tables, browse navigation,
object navigation, and activation. Keep the reader responsive while moving
a finger rapidly over a large page.
5. Tab and Shift+Tab through the touch preferences checkbox, Apply, reopen,
and restart using the saved test configuration to verify persistence.
Private automated tests do not establish physical touch, audible speech,
Braille, or preferences keyboard acceptance. The original contributor's live
results above are historical evidence, not verification of these review fixes.
Validation for this integration: the full Go suite passed in a private
Xvfb/D-Bus session; focused touch/review/app race checks and focused go vet
passed; native mouse hit testing, XRes window lookup, and held-key preservation
passed. The reader, input helper, and BrlAPI-tagged Braille helper built.
Translation catalog checks and git diff whitespace checks passed. No running
reader was replaced and no physical touchscreen acceptance was performed.