From 298b28d7f1eec7ebc7cd239915966ca0c322cf54 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 23 Feb 2018 11:21:04 +1000 Subject: [PATCH] touchpad: move the hysteresis into its own substruct Prep work for the wobbling detection patch Signed-off-by: Peter Hutterer Reviewed-by: Konstantin Kharlamov (cherry picked from commit e43bd4ae3a75f72b45c6bab6168bd859ab4a01b3) --- src/evdev-mt-touchpad.c | 10 +++++----- src/evdev-mt-touchpad.h | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 7bce8114..a024be28 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -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; } diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h index 442f34a3..4c2f156b 100644 --- a/src/evdev-mt-touchpad.h +++ b/src/evdev-mt-touchpad.h @@ -173,7 +173,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