#42

Improve touchpad scrolling with kinetic momentum

Openkevinherronwants to merge intofrom

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 ScrollEnd or a short event gap.

Platform-provided Qt.ScrollMomentum events 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 animated angleDelta mouse-wheel behavior remains intact.

The integration test sends phased QWheelEvent pixel deltas and verifies scaled movement, continued movement after release, and the platform-momentum handoff.

Activity

12
kevinherron1mo ago

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.

TNL4021mo ago

Tested this PR on an Omarchy laptop using only a trackpad. The momentum after finger release feels substantially better, but active finger-down scrolling remains close to 0.5.0 and noticeably slower than KDE Discover.

Discover is a useful comparison because it is also a Qt Quick application running through the same Wayland/libinput session with the same trackpad and scrolls normally on the affected machine.

Kirigami has an established Wayland/libinput workaround that prefers angleDelta when both are present because pixelDelta is too slow: https://invent.kde.org/frameworks/kirigami/-/merge_requests/415

I opened a focused follow-up against this branch that retains its bounded momentum and uses Kirigami’s standard 60px-per-notch conversion during the active gesture: https://github.com/kevinherron/omawrite/pull/1

All 13 tests pass, and the combined behavior was validated on the affected hardware.