[PATCH v4 libinput 1/3] touchpad: move the hysteresis into its own substruct
Peter Hutterer
peter.hutterer at who-t.net
Thu Mar 1 06:39:29 UTC 2018
Prep work for the wobbling detection patch
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
New in this series
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 2a6cdcef..75344661 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 afd0983d..3ce893d2 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -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
--
2.14.3
More information about the wayland-devel
mailing list