Improve touchpad scrolling with kinetic momentum - #42
Open
kevinherron wants to merge 1 commit into
Open
Conversation
Scale pixel-precise movement and preserve gesture velocity after release. Use platform momentum when available and bound the fallback coast.
Author
|
Sample size of 1 when it comes to testing this change on a physical touchpad. Works great on my old ThinkPad X1 Carbon Gen 6. I'll test on my XPS 14 when it gets here next week. |
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.
Pixel-precise touchpad scrolling currently applies raw deltas directly, so movement feels slow and stops abruptly when the fingers lift. This change scales touchpad movement by 2× and estimates gesture velocity to provide bounded, decaying momentum after
ScrollEndor a short event gap.Platform-provided
Qt.ScrollMomentumevents take precedence over the fallback momentum to prevent double scrolling. New gestures, mouse-wheel input, other movement, and content bounds stop momentum cleanly. The existing animatedangleDeltamouse-wheel behavior remains intact.The integration test sends phased
QWheelEventpixel deltas and verifies scaled movement, continued movement after release, and the platform-momentum handoff.