[libhandy] swipe-tracker: Only count drag from the threshold activation moment



commit 1ea4c6d76412193a1e71547d4b9b957292d10f84
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Mon Oct 26 19:15:39 2020 +0500

    swipe-tracker: Only count drag from the threshold activation moment
    
    Avoid a jump on thr first frame.
    
    While this is inconsistent with GtkScrolledWindow, this is what gnome-shell
    does, what Android does and in general the expected behavior.

 src/hdy-swipe-tracker.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/hdy-swipe-tracker.c b/src/hdy-swipe-tracker.c
index 03e518cb..a7bd0983 100644
--- a/src/hdy-swipe-tracker.c
+++ b/src/hdy-swipe-tracker.c
@@ -367,6 +367,7 @@ drag_update_cb (HdySwipeTracker *self,
     if (drag_distance >= DRAG_THRESHOLD_DISTANCE) {
       if ((is_vertical == is_offset_vertical) && !is_overshooting) {
         gesture_begin (self);
+        self->prev_offset = offset;
         gtk_gesture_set_state (self->touch_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
       } else {
         gtk_gesture_set_state (self->touch_gesture, GTK_EVENT_SEQUENCE_DENIED);


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