Skip to content

fix(flterm): preserve tracked pointer and touch state - #106

Closed
adonm wants to merge 2 commits into
elias8:mainfrom
adonm:upstream/101-pointer-touch
Closed

fix(flterm): preserve tracked pointer and touch state#106
adonm wants to merge 2 commits into
elias8:mainfrom
adonm:upstream/101-pointer-touch

Conversation

@adonm

@adonm adonm commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • preserve pointer identity, button, and coordinates across press, motion, release, cancellation, hover, and wheel input
  • send wheel events at their actual pointer position and retain fractional wheel deltas
  • add opt-in TouchMouseTracking.tapAndScroll: taps reach tracked terminal apps while touch/stylus drags remain local scrolling
  • keep TouchMouseTracking.direct as the compatibility default

Why

The previous path could fabricate (0, 0) wheel positions, lose the pressed button, and forward touch drags as held left-button motion, causing applications such as Zellij to select text instead of scrolling.

This is an independent extraction from #101, ported onto current main without the renderer-refactor commits.

Verification

  • flutter test with the supported prebuilt native-asset provider: 703 passed
  • dart format --output=none --set-exit-if-changed packages/flterm: clean
  • dart analyze packages/flterm: only the 3 existing info-level collection-style lints

@adonm

adonm commented Aug 26, 2026

Copy link
Copy Markdown
Author

Addressed by the upstream interaction rewrite. Closing.

Each gap this PR fixed is now covered on main:

  • Tracked pointer state: InteractionRegion (bf6ea62) keeps a per-pointer _TrackedPointer (button, buttons, kind, position, tap candidate) across press/motion/release/cancel/hover, and MouseInput.anyButtonPressed landed with the upstream C API regeneration (a3f33fa/…). The nullable-button contract this PR added is the current MouseInput shape.
  • Wheel at actual pointer position with fractional deltas: ScrollGestureRegion (6deaece) forwards PointerScrollEvent.localPosition and scrollDelta.
  • Touch drags scroll locally, taps reach tracked apps: the interaction region's tap-candidate model (_releaseTrackedPointer sends press+release only when the touch stays within slop) implements the scroll-first behavior; upstream chose always-on rather than the opt-in TouchMouseTracking.tapAndScroll flag this PR proposed.

The tapAndScroll opt-in API is the only piece with no upstream equivalent. If you want it as a separate toggle on the current gesture settings, happy to file a focused follow-up.

@adonm

adonm commented Aug 26, 2026

Copy link
Copy Markdown
Author

Closing as addressed; see the comment above mapping each fix to the upstream commits that cover it.

@adonm adonm closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant