Bug Description
OneSequenceGestureRecognizer.rejectGesture is a no-op ({}). When a recognizer loses the gesture arena, it never calls stopTrackingPointer() or cleans up _entries. This means:
- Tracked pointers remain routed in the pointer router indefinitely
_entries retains stale GestureArenaEntry references
- Losing team members in
GestureArenaTeam scenarios retain per-pointer state forever
This is the root cause behind the TODO in startTrackingPointer:
// TODO(goderbauer): Enable assert after recognizers properly clean up
// their defunct _entries, see https://github.com/flutter/flutter/issues/117356
Steps to Reproduce
- Create a
GestureArenaTeam with two recognizers
- Add a pointer — both recognizers track it
- Close the arena — one wins, the other is rejected
- The rejected recognizer still has its pointer route active and
_entries intact
Expected Behavior
rejectGesture should call stopTrackingPointer and remove the stale _entries entry, with all subclass overrides properly calling through to the base implementation.
Fix
PR: #187515
OneSequenceGestureRecognizer.rejectGesture: now calls stopTrackingPointer + removes _entries, marked @mustCallSuper
- All subclass overrides (
PrimaryPointer, Drag, ForcePress, Scale, TapAndDrag) propagate the super.rejectGesture(pointer) call
_TapStatusTrackerMixin.rejectGesture now calls super to ensure the chain reaches the base cleanup
PrimaryPointerGestureRecognizer.didStopTrackingLastPointer now correctly transitions to ready state and clears initialPosition after rejection
Related: #117356
Bug Description
OneSequenceGestureRecognizer.rejectGestureis a no-op ({}). When a recognizer loses the gesture arena, it never callsstopTrackingPointer()or cleans up_entries. This means:_entriesretains staleGestureArenaEntryreferencesGestureArenaTeamscenarios retain per-pointer state foreverThis is the root cause behind the TODO in
startTrackingPointer:Steps to Reproduce
GestureArenaTeamwith two recognizers_entriesintactExpected Behavior
rejectGestureshould callstopTrackingPointerand remove the stale_entriesentry, with all subclass overrides properly calling through to the base implementation.Fix
PR: #187515
OneSequenceGestureRecognizer.rejectGesture: now callsstopTrackingPointer+ removes_entries, marked@mustCallSuperPrimaryPointer,Drag,ForcePress,Scale,TapAndDrag) propagate thesuper.rejectGesture(pointer)call_TapStatusTrackerMixin.rejectGesturenow calls super to ensure the chain reaches the base cleanupPrimaryPointerGestureRecognizer.didStopTrackingLastPointernow correctly transitions toreadystate and clearsinitialPositionafter rejectionRelated: #117356