Skip to content

gdk: fix reversed and sluggish scrolling on MacOS

Andy Russell requested to merge euclio/gtk:mac-scrolling-fix into main

When using an external mouse on MacOS, the scrolling behavior is reversed from the user's scrolling preference. Additionally, it is noticeably sluggish.

This commit fixes both issues by negating the deltas and multiplying them by 32 before constructing a new scroll event. 32 seems to be the "traditional" scaling factor according to Druid, but I'm not sure where that value actually comes from. Regardless, scaling the deltas by this amount makes scrolling feel a lot more responsive in the GTK demos.

Scrolling with a trackpad is not affected by either issue because it triggers a different code path that uses more precise deltas, and already negates them.

Merge request reports