Repository navigation
馃悶 Stop trackpad gestures from scrolling the page behind them - #1176
Merged
Merged
Conversation
mrkai77
force-pushed
the
kai/gesture-scroll-leak
branch
2 times, most recently
from
October 13, 2026 07:41
9ea1378 to
3833cb0
Compare
mrkai77
force-pushed
the
kai/gesture-scroll-leak
branch
from
October 13, 2026 07:42
3833cb0 to
2d2517c
Compare
4 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
beganwhile 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,kIOHIDEventTypeNavigationSwipe, aka what browsers use for back/forward) the same way as scrolls,scrollOwner(heldFor:direction:)toSystemGestureFilterso 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.