Skip to content

Tell wheel from touchpad by scroll phase, and speed up touchpads - #129

Open
timolehto wants to merge 1 commit into
omacom:masterfrom
timolehto:wheel-by-phase
Open

timolehto wants to merge 1 commit into
omacom:masterfrom
timolehto:wheel-by-phase

Conversation

@timolehto

@timolehto timolehto commented Oct 22, 2026 •

Copy link
Copy Markdown

Fixes #130.

Problem

Since Qt 6.12, mouse wheel scrolling in the editor is about 8 times too slow on Wayland, and Ctrl+wheel zoom needs several notches per step.

Qt 6.12 started passing Wayland's pixel value through for wheel notches (qtbase d19bd66b4, "wayland: Always populate pixelDelta for axis scroll events"). Before that, Qt dropped it for wheel sources. The WheelHandler tells a wheel from a touchpad by whether pixelDelta is set, so every notch now takes the one-to-one touchpad path and moves 15px instead of the 120px wheel step.

What a Qt 6.12 app receives on Hyprland:

Input phase pixelDelta.y angleDelta.y
one wheel notch NoScrollPhase −15 −120
two-finger scroll, per event ScrollUpdate 0 to −2 −5 to −27

Touchpad scrolling is slow on its own as well: pixels taken one to one crawl next to other apps under the same compositor (see the comments on #42).

How

  • Tell a wheel from a touchpad by scroll phase. Qt wraps finger scrolling in ScrollBegin/ScrollUpdate/ScrollEnd and gives wheel notches NoScrollPhase, on every Qt version. Both scrolling and Ctrl+wheel zoom use the same isTouchpad() test.
  • Scale touchpad pixels by 6 (touchpadGain). Qt reports 12 angle units per touchpad pixel, so this is 60px per 120 angle units, the rate Improve touchpad scrolling with kinetic momentum #42 uses.

Verification

  • bin/test: 110 passed, 0 failed.
  • New test scrollsWheelNotchesAndTouchpadByPhase sends a notch with pixelDelta −15 and checks it scrolls a full wheelStep, then checks a touchpad event moves pixelDelta × touchpadGain. On master it fails: the notch moves 15px.
  • banksTouchpadScrollBeforeChangingTextSize now passes the phase, and its wheel notch carries the 15px value too.
  • Built build/omawrite and tried a USB wheel mouse and a touchpad on a long document (Omarchy / Hyprland, Qt 6.12.0).
  • Feel: wheel and touchpad now scroll about as far as other apps on the same machine, such as foot. A full roll of the wheel under one finger moves about one 1080p screen, and an edge-to-edge swipe on a Lenovo laptop touchpad about two.

This only fixes the scroll distance. It adds no momentum after the fingers lift; that is #42 and #53.

Related: #42, #53, #71.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No established issue blocks merging this PR.

Summary

This PR uses scroll phase to tell wheel notches from touchpad gestures.

  • The editor separates wheel notches from touchpad scrolling by scroll phase.

No actionable issues were established. Tests were not run during this review.

Reviews (2) · Last reviewed commit: "Tell wheel from touchpad by scroll phase..." · Reviewed by Greptile

@ch-arslanahmad

Copy link
Copy Markdown

I second this.. The default scrolling is incredibly slow.

@nojaf

nojaf commented Nov 17, 2026

Copy link
Copy Markdown

Hi @timolehto, thank you for tracking this down and for such a clear write-up! The table of what Qt 6.12 actually sends made the cause easy to follow.

I'm running into the same thing on Omawrite 0.7.2 (the Omarchy package) with Qt 6.12.0 on Hyprland and a Logitech MX Master 4: one wheel notch moves about a line, so your fix would make a real difference.

Since the 0.7.x releases landed, the branch has fallen behind master and now has conflicts. Would you be up for rebasing it when you get a chance? And if you're busy, no worries at all: I'd be glad to open a rebased version that keeps you as the commit author and credits this PR.

Qt 6.12 started passing Wayland's pixel value through for wheel
notches (qtbase d19bd66b4, "wayland: Always populate pixelDelta for
axis scroll events"), so a notch now arrives with pixelDelta 15 beside
angleDelta 120. Testing pixelDelta therefore sent every notch down the
one-to-one touchpad path: 15px instead of the 120px wheel step, eight
times too slow. Ctrl+wheel zoom needed several notches per step for
the same reason. Qt wraps finger scrolling in ScrollBegin/Update/End
and gives wheel notches no phase, on every Qt version, so test the
phase instead.

Touchpad pixels taken one to one also crawl next to other apps under
the same compositor. Scale them by 6: Qt reports 12 angle units per
touchpad pixel, so that is 60px per 120 angle units, the rate omacom#42 uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@timolehto

Copy link
Copy Markdown
Author

@nojaf thanks for the nudge. Rebased onto current master (0.7.5). The code is unchanged: the only snag was that the CMake move renamed tests/tst_omawrite.cpp to tests/omawrite_tests.cpp. bin/test passes (125 tests), and the new scroll test still fails without the fix.

The Omarchy stable channel still ships 0.7.2. If you want to patch that version, the pre-rebase commit is on wheel-by-phase-v0.7.2. It applies cleanly on top of the v0.7.2 tag and builds with qmake as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wheel and touchpad scroll far less than other apps on Wayland (wheel since Qt 6.12)

3 participants