Skip to content

MacOS: improve scroll smoothing #13036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

stephomi
Copy link
Contributor

@stephomi stephomi commented May 14, 2025

Use scrollingDelta instead of delta, as recommended by the Apple documentation. It gives much smoother scrolling.


I'm switching from glfw to sdl and I noticed the scrolling is very janky in SDL on macos (very few wheel events).

Empirically, I noticed glfw multipling by 0.1 if hasPreciseScrollingDeltas is on, and it indeed gives me similar speed to delta (but much smoother).

Note: I don't think the ceil/floor is needed anymore if hasPreciseScrollingDeltas is false, but I'm not 100% sure as my macbook supports hasPreciseScrollingDeltas. In the end I did the same as in glfw

Use scrollingDelta instead of delta, as recommended by the Apple documentation.
It gives much smoother scrolling.
@slouken
Copy link
Collaborator

slouken commented May 14, 2025

There's some interaction with trackpad scrolling here, so this needs further review.

@slouken slouken requested a review from icculus May 14, 2025 17:24
@slouken slouken added this to the 3.4.0 milestone May 14, 2025
@stephomi
Copy link
Contributor Author

I only tested with the macOS trackpad

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.

2 participants