touchpad: move the hysteresis into its own substruct
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 23 Feb 2018 01:21:04 +0000 (11:21 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 1 Mar 2018 06:34:24 +0000 (16:34 +1000)
Prep work for the wobbling detection patch

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
src/evdev-mt-touchpad.c
src/evdev-mt-touchpad.h

index 2a6cdcefd568c96248e2832e759f72c5ef653c5d..7534466166ad03536de43f1bd29a5c0c85209efc 100644 (file)
@@ -162,16 +162,16 @@ tp_motion_hysteresis(struct tp_dispatch *tp,
                return;
 
        if (t->history.count == 0) {
-               t->hysteresis_center = t->point;
+               t->hysteresis.center = t->point;
        } else {
                x = evdev_hysteresis(x,
-                                    t->hysteresis_center.x,
+                                    t->hysteresis.center.x,
                                     tp->hysteresis.margin.x);
                y = evdev_hysteresis(y,
-                                    t->hysteresis_center.y,
+                                    t->hysteresis.center.y,
                                     tp->hysteresis.margin.y);
-               t->hysteresis_center.x = x;
-               t->hysteresis_center.y = y;
+               t->hysteresis.center.x = x;
+               t->hysteresis.center.y = y;
                t->point.x = x;
                t->point.y = y;
        }
index afd0983d70a275320e235f4783f785e12d597428..3ce893d220a9e5c217117e4a6c7523c1da88fa77 100644 (file)
@@ -175,7 +175,9 @@ struct tp_touch {
                unsigned int count;
        } history;
 
-       struct device_coords hysteresis_center;
+       struct {
+               struct device_coords center;
+       } hysteresis;
 
        /* A pinned touchpoint is the one that pressed the physical button
         * on a clickpad. After the release, it won't move until the center