Android: multitouch gesture state sticks after lifting a finger, one-finger pan never starts
Description
On Android (remote control from a phone), after a two-finger scale ends by lifting one finger, moving the remaining finger never triggers a one-finger pan. The gesture recognizer appears stuck in the finished two-finger state: no pan starts no matter how long the finger keeps moving.
Code: flutter/lib/common/widgets/gestures.dart, CustomTouchGestureRecognizer (used from flutter/lib/common/widgets/remote_input.dart).
Root cause (suspected)
A single _debounceTimer is overloaded for two purposes:
- debouncing downward transitions (e.g. two-finger -> one-finger start), armed in
onOneFingerStartDebounce/onTwoFingerStartDebounce; - the 200ms post-
onEndreset toGestureState.none.
onUpdate cancels _debounceTimer on every move, so continuous movement after onEnd keeps cancelling the pending reset and re-arming the pending start. The state therefore never returns to none while the finger moves, and the debounced start keeps sliding its deadline: the gesture is stuck.
Reproduction (conceptual)
- On Android, start a two-finger scale (pinch) on the remote session.
- Lift one finger (
onEndfires, 200ms reset is armed). - Keep moving the remaining finger continuously.
- Expected: a one-finger pan starts within ~200ms.
- Actual: no pan ever starts while moving continues.
Suggested direction
Split the post-end reset into its own timer (e.g. _resetTimer) so moves only cancel/re-arm the pending start debounce and never the reset. New gesture starts cancel the reset timer. This keeps the existing 200ms debounce behavior unchanged instead of resetting state synchronously (which would drop the pinch-release protection and cause spurious pans). rejectGesture/dispose should cancel both timers.
History
- #15786 (larger state-machine rework) was closed: big core-logic changes can't be accepted.
- #15799 (minimal draft) was closed without merge.
- Filing this issue to track the problem itself; happy to submit a minimal additive fix with a focused regression test if maintainers agree on the direction.
Environment
- Controlling device: Android phone (Xperia, exact model / OS version to be confirmed)
- App build: current master
Source: rustdesk/rustdesk