[PATCH libinput 2/4] touchpad: move hysteresis margin into its own struct

Peter Hutterer peter.hutterer at who-t.net
Mon Oct 30 23:52:30 UTC 2017


No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-mt-touchpad.c | 8 ++++----
 src/evdev-mt-touchpad.h | 4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 1ad66fb0..501744ac 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -143,10 +143,10 @@ tp_motion_hysteresis(struct tp_dispatch *tp,
 	} else {
 		x = evdev_hysteresis(x,
 				     t->hysteresis_center.x,
-				     tp->hysteresis_margin.x);
+				     tp->hysteresis.margin.x);
 		y = evdev_hysteresis(y,
 				     t->hysteresis_center.y,
-				     tp->hysteresis_margin.y);
+				     tp->hysteresis.margin.y);
 		t->hysteresis_center.x = x;
 		t->hysteresis_center.y = y;
 		t->point.x = x;
@@ -2899,8 +2899,8 @@ tp_init_hysteresis(struct tp_dispatch *tp)
 
 	res_x = tp->device->abs.absinfo_x->resolution;
 	res_y = tp->device->abs.absinfo_y->resolution;
-	tp->hysteresis_margin.x = res_x/2;
-	tp->hysteresis_margin.y = res_y/2;
+	tp->hysteresis.margin.x = res_x/2;
+	tp->hysteresis.margin.y = res_y/2;
 }
 
 static void
diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
index 9d9f0826..6110a2bc 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -269,7 +269,9 @@ struct tp_dispatch {
 		double orientation_to_angle;
 	} touch_size;
 
-	struct device_coords hysteresis_margin;
+	struct {
+		struct device_coords margin;
+	} hysteresis;
 
 	struct {
 		double x_scale_coeff;
-- 
2.13.6



More information about the wayland-devel mailing list