Repository navigation
Wayland: fix scroll axis units - #22207
Merged
MrJul merged 1 commit intoSep 10, 2026
Merged
Conversation
Only wheels send axis_value120, so continuous sources fell through to the raw axis value, whose logical-pixel distance was read as a detent count. Convert it at 10px per detent instead, the convention GTK3, Qt, SDL and Chromium all assume, which also matches Avalonia's own X11 backend. Touchpad scrolling on Wayland becomes 10x slower as a result.
|
You can test this PR using the following package version. |
Collaborator
|
Contributor
Author
|
@cla-avalonia agree |
MrJul
approved these changes
Sep 10, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 10, 2026
MrJul
pushed a commit
to MrJul/Avalonia
that referenced
this pull request
Sep 22, 2026
Only wheels send axis_value120, so continuous sources fell through to the raw axis value, whose logical-pixel distance was read as a detent count. Convert it at 10px per detent instead, the convention GTK3, Qt, SDL and Chromium all assume, which also matches Avalonia's own X11 backend. Touchpad scrolling on Wayland becomes 10x slower as a result.
grokys
pushed a commit
to Evan260/Avalonia
that referenced
this pull request
Oct 7, 2026
Only wheels send axis_value120, so continuous sources fell through to the raw axis value, whose logical-pixel distance was read as a detent count. Convert it at 10px per detent instead, the convention GTK3, Qt, SDL and Chromium all assume, which also matches Avalonia's own X11 backend. Touchpad scrolling on Wayland becomes 10x slower as a result.
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.
What does the pull request do?
Correctly scales continuous (touchpad, trackpoint) scroll deltas on Wayland backend.
What is the current behavior?
WaylandInputDispatchertreats raw pixel deltas as full mouse wheel notches, causing the scroll to be uncontrollably fast.What is the updated/expected behavior with this PR?
Touchpad scrolling on Wayland has a normal speed, similar to X11.
How was the solution implemented (if it's not obvious)?
Only wheel sources send
axis_value120, so every continuous source falls through to the raw axis value.WaylandInputDispatchernow divides the raw axis value by 10 pixels per detent, matching other Wayland clients:gdkdevice-wayland.c:1924wl_fixed_to_double (value) / 10.0gtkeventcontrollerscroll.c:68#define SURFACE_UNIT_DISCRETE_MAPPING 10qwaylandinputdevice.cpp:1114delta * -12against a 120-per-detent scaleSDL_waylandevents.c:78#define WAYLAND_WHEEL_AXIS_UNIT 10wayland_pointer.cc:192constexpr double kAxisValueScale = 10.0Checklist
Breaking changes
none
Obsoletions / Deprecations
none
Fixed issues
Fixes #22034