[PATCH libinput 3/4] touchpad: add an enabled toggle to the hysteresis

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


Hardcoded to 'enabled' right now

No functional changes

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

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 501744ac..a3e243b3 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -138,6 +138,9 @@ tp_motion_hysteresis(struct tp_dispatch *tp,
 	int x = t->point.x,
 	    y = t->point.y;
 
+	if (!tp->hysteresis.enabled)
+		return;
+
 	if (t->history.count == 0) {
 		t->hysteresis_center = t->point;
 	} else {
@@ -2901,6 +2904,7 @@ tp_init_hysteresis(struct tp_dispatch *tp)
 	res_y = tp->device->abs.absinfo_y->resolution;
 	tp->hysteresis.margin.x = res_x/2;
 	tp->hysteresis.margin.y = res_y/2;
+	tp->hysteresis.enabled = true;
 }
 
 static void
diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
index 6110a2bc..ab4bcde1 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -270,6 +270,7 @@ struct tp_dispatch {
 	} touch_size;
 
 	struct {
+		bool enabled;
 		struct device_coords margin;
 	} hysteresis;
 
-- 
2.13.6



More information about the wayland-devel mailing list