summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-11-21 20:34:29 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-12-08 15:28:37 +0100
commit2f29cb9e6f7e41d19515a8c9778ef0687a3dd0e2 (patch)
tree8d6409d1ecf7c5d90c129fffd4b938737115cbc5
parent67fdfca3ba28d82a7cfe02d4d5fe34c910e6c959 (diff)
downloadgtk+-2f29cb9e6f7e41d19515a8c9778ef0687a3dd0e2.tar.gz
win32: Don't multiply the scroll event deltas by the Windows scroll lines setting. See #1408
GTK widgets expect the scroll deltas to be 1 or -1 and calculate a scroll value from that. Multiplying the delta by the Windows scroll line setting (which defaults to 3) results in a much larger delta and vastly different behaviour for running a GTK app on Windows vs on Linux. For example text view and tree view scroll by 9 lines per scroll wheel tick per default this way while on Linux it is around 3. Remove the multiplication for now. See !426 for the gtk3 MR
-rw-r--r--gdk/win32/gdkevents-win32.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index ed31ba5b51..712115072a 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2717,25 +2717,11 @@ gdk_event_translate (MSG *msg,
if (msg->message == WM_MOUSEWHEEL)
{
- UINT lines_multiplier = 3;
event->scroll.delta_y = (gdouble) GET_WHEEL_DELTA_WPARAM (msg->wParam) / (gdouble) WHEEL_DELTA;
- /* -1 means that we should scroll in screens, not lines.
- * Right now GDK doesn't support that.
- */
- if (SystemParametersInfo (SPI_GETWHEELSCROLLLINES, 0, &lines_multiplier, 0) &&
- lines_multiplier != (UINT) -1)
- event->scroll.delta_y *= (gdouble) lines_multiplier;
}
else if (msg->message == WM_MOUSEHWHEEL)
{
- UINT chars_multiplier = 3;
event->scroll.delta_x = (gdouble) GET_WHEEL_DELTA_WPARAM (msg->wParam) / (gdouble) WHEEL_DELTA;
- /* There doesn't seem to be any indication that
- * h-scroll has an equivalent of the "screen" mode,
- * indicated by multiplier being (UINT) -1.
- */
- if (SystemParametersInfo (SPI_GETWHEELSCROLLCHARS, 0, &chars_multiplier, 0))
- event->scroll.delta_x *= (gdouble) chars_multiplier;
}
/* Positive delta scrolls up, not down,
see API documentation for WM_MOUSEWHEEL message.