Skip to content

Wayland: fix scroll axis units - #22207

Merged
MrJul merged 1 commit into
AvaloniaUI:mainfrom
George-Payne:fix/wayland-scroll-axis-units
Sep 10, 2026
Merged

MrJul merged 1 commit into
AvaloniaUI:mainfrom
George-Payne:fix/wayland-scroll-axis-units

Conversation

@George-Payne

Copy link
Copy Markdown
Contributor

What does the pull request do?

Correctly scales continuous (touchpad, trackpoint) scroll deltas on Wayland backend.

What is the current behavior?

WaylandInputDispatcher treats 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. WaylandInputDispatcher now divides the raw axis value by 10 pixels per detent, matching other Wayland clients:

Checklist

Breaking changes

none

Obsoletions / Deprecations

none

Fixed issues

Fixes #22034

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.
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0069767-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia

cla-avalonia commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator
  • All contributors have signed the CLA.

@George-Payne

Copy link
Copy Markdown
Contributor Author

@cla-avalonia agree

@MrJul MrJul added bug area-wayland backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Sep 10, 2026

@MrJul MrJul left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, this works as expected: listboxes no longer scroll 20+ items at once.
LGTM!

@MrJul
MrJul added this pull request to the merge queue Sep 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 10, 2026
@MrJul
MrJul added this pull request to the merge queue Sep 10, 2026
Merged via the queue into AvaloniaUI:main with commit 0e0e5bb Sep 10, 2026
10 checks passed
@George-Payne
George-Payne deleted the fix/wayland-scroll-axis-units branch September 10, 2026 18:24
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.
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Sep 22, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Wayland] Touchpad scroll speed is way too fast compared to X11

4 participants