Skip to content

GDK W32: Support smooth scrolling

LRN requested to merge lrn/gtk:win32-scroll-deltas into gtk-3-24

Set delta_x or delta_y for GdkScrollEvent. HIWORD (wParam) in WM_MOUSE(H)WHEEL is the scroll delta. A delta value of WHEEL_DELTA (which is 120) means scrolling one full unit of something (for example, a line).

The delta should also be multiplied by the value that the SystemParametersInfo (SPI_GETWHEELSCROLL(LINES|CHARS), 0, &value, 0) call gives back, unless it gives back 0xffffffff, in which case it indicates that scrolling is page- or screen-based, not line-based (GDK doesn't support that at the moment).

Also, all deltas should be inverted, since MS sends negative deltas when scrolling down (rotating the wheel back, in the direction of the user).

With deltas set the mode should be set to GDK_SCROLL_SMOOTH.

Fixes issue #1263 (closed).

Merge request reports