Skip to content

馃悶 Stop trackpad gestures from scrolling the page behind them - #1176

Merged
mrkai77 merged 1 commit into
developfrom
kai/gesture-scroll-leak
Oct 13, 2026
Merged

mrkai77 merged 1 commit into
developfrom
kai/gesture-scroll-leak

Conversation

@mrkai77

@mrkai77 mrkai77 commented Oct 9, 2026

Copy link
Copy Markdown
Owner

With the native macOS gestures turned off, 3 and 4-finger Loop gestures would also scroll the page underneath, keep scrolling after lifting your fingers, and even trigger back/forward in browsers. This is because macOS turns unassigned 3 and 4-finger swipes into scrolls, and the gesture blocker only kicked in once Loop had recognized the gesture. By then, the page had already started scrolling, and the momentum carried on after the lift. This PR:

  1. Holds scrolls that could belong to a Loop gesture from began while Loop decides on the stroke. If Loop takes it, the scroll is dropped. Otherwise, the held events are replayed in order through the tap proxy,
  2. Lets swipes in unbound directions pass straight through, so they still scroll with no delay,
  3. Decides momentum once, when it begins, so a stroke Loop took no longer flings the page after you lift your fingers,
  4. Holds and replays navigation swipes (kIOHIDEventTypeNavigationSwipe, aka what browsers use for back/forward) the same way as scrolls,
  5. Blocks rotation, zoom and smart zoom while a Loop gesture is active. Touch frames, force clicks and gesture brackets still pass, so apps don't get stuck mid-gesture,
  6. Adds scrollOwner(heldFor:direction:) to SystemGestureFilter so the blocker can tell whether Loop owns the current touch. Loop keeps ownership until every finger lifts, since they rarely leave at the same time.

@mrkai77 mrkai77 self-assigned this Oct 9, 2026
@mrkai77 mrkai77 added the Bug label Oct 9, 2026
@mrkai77
mrkai77 force-pushed the kai/gesture-scroll-leak branch 2 times, most recently from 9ea1378 to 3833cb0 Compare October 13, 2026 07:41
@mrkai77
mrkai77 force-pushed the kai/gesture-scroll-leak branch from 3833cb0 to 2d2517c Compare October 13, 2026 07:42
@mrkai77
mrkai77 merged commit 573ace3 into develop Oct 13, 2026
1 check passed
@mrkai77
mrkai77 deleted the kai/gesture-scroll-leak branch October 13, 2026 07:44
@jvanderen1 jvanderen1 mentioned this pull request Oct 19, 2026
4 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant