[gtk/gtk-3-24: 2/3] GDK W32: fix direction of horizontal smooth scrolling events



commit 46dfd139ef263efbd2630756f4175ad57b67402c
Author: Eduard Braun <eduard braun2 gmx de>
Date:   Thu Sep 13 16:17:51 2018 +0200

    GDK W32: fix direction of horizontal smooth scrolling events
    
    Commit 359df028be7b1dae76a1abb9bad8a3b86a648765 changed the
    code to send GDK_SCROLL_SMOOTH with deltas instead of
    GDK_SCROLL_(UP|DOWN|LEFT|RIGHT).
    
    Windows defines deltas inversed for vertical direction
    (positive values mean the wheel was turned forward)
    but not for horizontal direction
    (positive values mean the wheel was turned towards the right).
    
    This commit fixes behavior as both axes were inverted previously.

 gdk/win32/gdkevents-win32.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 8b2d2f7ec9..a410d5acce 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -3095,10 +3095,9 @@ gdk_event_translate (MSG  *msg,
           if (SystemParametersInfo (SPI_GETWHEELSCROLLCHARS, 0, &chars_multiplier, 0))
             event->scroll.delta_x *= (gdouble) chars_multiplier;
         }
-      /* It seems that delta values given by Windows are
-       * inverted (positive delta scrolls up, not down).
+      /* Positive delta scrolls up, not down,
+         see API documentation for WM_MOUSEWHEEL message.
        */
-      event->scroll.delta_x *= -1.0;
       event->scroll.delta_y *= -1.0;
       event->scroll.time = _gdk_win32_get_next_tick (msg->time);
       event->scroll.x = (gint16) point.x / impl->window_scale;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]