Fix scrolling - #71
Open
tobiasbischoff wants to merge 1 commit into
Open
tobiasbischoff wants to merge 1 commit into
tobiasbischoff wants to merge 1 commit into
Conversation
Flickable still turns wheel notches into a tiny font-sized flick, and the previous Impulse curve dumped most of each notch in the first frames, so the mouse felt jumpy. Touchpad pixel events were applied one-to-one with no coast, then died on lift, which is nothing like a Mac trackpad or Chrome. Keep the two-path split Wayland forces (pixelDelta is a touchpad, angle-only notches are a mouse). Mouse notches now ease-out over ~300ms without snapping every frame. Touchpad tracking stays 1:1 at low speed, gains up to ~2.25× on a flick, and continues with an exponential fling after lift. Two fingers back after a pause catch the coast; continuing the same swipe does not.
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.
Problem
Mouse wheel and touchpad scrolling both felt off.
The wheel already had a custom animation, but the Impulse curve dumped most of each notch in the first frames and
contentYsnapped to a device pixel on every frame. A notch jumped, then crawled.Two-finger scrolling tracked 1:1 and stopped dead on lift: no acceleration on a flick, no inertial coast.
On Wayland, Qt reports every pointer's scroll as a touchpad, so mouse and fingers have to be told apart by event shape. Mixing those paths made notches take the pixel path (tiny motion) or pixel gestures take the notch path (120px jumps).
How
Two paths, split the way Wayland requires:
angleDeltaonly): ease-out toward a running 120px-per-notch target over ~300ms, without per-frame snapping. Consecutive notches retarget the same animation so a spin stays one motion.pixelDelta): 1:1 at low speed, gain ramping toward ~2.25× on a flick, then an exponential fling after lift (τ = 460ms). A new contact after a pause catches the coast; continuing the same swipe does not.Flickable still does not see these events. Letting it handle pixel scrolling rebounds to the drag origin.
Verification
bin/test: 12 passed, 0 failed.build/omawriteand exercised mouse wheel and two-finger scrolling on a long document (Omarchy / Hyprland).