[gtk+] gdk/wayland: Drop emission of emulated scroll events



commit d271b135bbe92036ff8d63113005c9bc5edfccf5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Sep 15 13:20:16 2017 +0200

    gdk/wayland: Drop emission of emulated scroll events
    
    A wl_pointer.frame can now only result on one scroll event
    being emitted.

 gdk/wayland/gdkdevice-wayland.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 1bc142a..61a4d50 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1387,10 +1387,9 @@ flush_scroll_event (GdkWaylandSeat             *seat,
       pointer_frame->discrete_x = 0;
       pointer_frame->discrete_y = 0;
     }
-
-  if (pointer_frame->is_scroll_stop ||
-      pointer_frame->delta_x != 0 ||
-      pointer_frame->delta_y != 0)
+  else if (pointer_frame->is_scroll_stop ||
+           pointer_frame->delta_x != 0 ||
+           pointer_frame->delta_y != 0)
     {
       /* Axes can stop independently, if we stop on one axis but have a
        * delta on the other, we don't count it as a stop event.
@@ -1404,11 +1403,13 @@ flush_scroll_event (GdkWaylandSeat             *seat,
                                  pointer_frame->delta_x,
                                  pointer_frame->delta_y,
                                  is_stop);
-
-      pointer_frame->delta_x = 0;
-      pointer_frame->delta_y = 0;
-      pointer_frame->is_scroll_stop = FALSE;
     }
+
+  pointer_frame->discrete_x = 0;
+  pointer_frame->discrete_y = 0;
+  pointer_frame->delta_x = 0;
+  pointer_frame->delta_y = 0;
+  pointer_frame->is_scroll_stop = FALSE;
 }
 
 static void


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