Android: on-screen controls vs. system gestures #826

Open
aoleg94 wants to merge 2 commits from aoleg94/android-fix-touch-cancel into main
aoleg94 commented 2026-10-03 17:41:47 -05:00 (Migrated from github.com)

Summary

  • Stuck controls. A system gesture that starts on the controls (e.g. swiping home from the
    left stick) takes the touch over with ACTION_CANCEL. The controls only released on
    ACTION_UP, so the stick, a button or a touchpad finger stayed held, even into the next session.
    TouchTracker (stick, d-pad), ButtonView and TouchpadView now release on cancel.
  • Controls reacting to edge swipes. Touches that start in the window's
    systemGestures() insets (back zones at the sides, home at the bottom) are meant for the
    system; the controls now ignore them.

Testing

  • New TouchTrackerTest (cancel fails before the fix) and SystemGestureAreaTest.
    TouchTracker gained an overload taking action, pointer id and positions so it can be tested
    without MotionEvent. ./gradlew testDebugUnitTest passes.
  • Galaxy Z Fold 4 (gesture navigation) + PS5: home swipe from the stick no longer leaves it
    deflected; Back swipe from the left edge doesn't move the stick.

Notes

Developed with the assistance of Claude Code, and tested on real hardware as described above.

🤖 Generated with Claude Code

### Summary - **Stuck controls.** A system gesture that starts on the controls (e.g. swiping home from the left stick) takes the touch over with `ACTION_CANCEL`. The controls only released on `ACTION_UP`, so the stick, a button or a touchpad finger stayed held, even into the next session. `TouchTracker` (stick, d-pad), `ButtonView` and `TouchpadView` now release on cancel. - **Controls reacting to edge swipes.** Touches that start in the window's `systemGestures()` insets (back zones at the sides, home at the bottom) are meant for the system; the controls now ignore them. ### Testing - New `TouchTrackerTest` (cancel fails before the fix) and `SystemGestureAreaTest`. `TouchTracker` gained an overload taking action, pointer id and positions so it can be tested without `MotionEvent`. `./gradlew testDebugUnitTest` passes. - Galaxy Z Fold 4 (gesture navigation) + PS5: home swipe from the stick no longer leaves it deflected; Back swipe from the left edge doesn't move the stick. ### Notes Developed with the assistance of Claude Code, and tested on real hardware as described above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'aoleg94/android-fix-touch-cancel:aoleg94/android-fix-touch-cancel'
git switch 'aoleg94/android-fix-touch-cancel'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'aoleg94/android-fix-touch-cancel'
git switch 'aoleg94/android-fix-touch-cancel'
git rebase 'main'
git switch 'main'
git merge --ff-only 'aoleg94/android-fix-touch-cancel'
git switch 'aoleg94/android-fix-touch-cancel'
git rebase 'main'
git switch 'main'
git merge --no-ff 'aoleg94/android-fix-touch-cancel'
git switch 'main'
git merge --squash 'aoleg94/android-fix-touch-cancel'
git switch 'main'
git merge --ff-only 'aoleg94/android-fix-touch-cancel'
git switch 'main'
git merge 'aoleg94/android-fix-touch-cancel'
git push origin 'main'
Sign in to join this conversation.
No description provided.