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.
Fixes #106168
get_delta() on Wayland is set to return a value intended to be interpreted as a measure of some amount of pixels, however previously it was being multiplied by another pixel value (page size) before scrolling was applied, which makes no sense dimensionally.
As for MacOS, get_delta() returns a value that seems to be set with unspecified units by the documentation. When hasPreciseScrollingDeltas is true, the docs imply the value can be used as-is, and based on the mulitpliers within the MacOS input handling code and the get_delta() code that was originally written only for MacOS, it's presumably a similar measurement to what Wayland uses, although I don't have a Mac to test this on.
As for when hasPreciseScrollingDeltas is false, the units are supposed to be application-defined rows or lines; panning events don't make sense to use here, however there is already code that switches between emitting panning events and scroll events on MacOS; presumably, this code works and this PR would have no effect on it.
Relevant docs:
https://developer.apple.com/documentation/appkit/nsevent/scrollingdeltay
https://developer.apple.com/documentation/appkit/nsevent/scrollingdeltax
Panning events only appear to be used on Wayland and MacOS, whereas other platforms use scroll events, so this should not affect Windows or other platforms.
This PR will probably result in some changes to the scroll speed on MacOS, and I don't have a Macbook with a trackpad to test it on. By some rough math it shouldn't change significantly, but it's difficult to measure because previously the scroll speed depended on the size of the window; splitting the screen one app on top and Godot on the bottom could cut the scroll speed of individual panels into thirds or less.