[PATCH libinput 1/2] touchpad: make the edge-scroll edge 7mm wide

Peter Hutterer peter.hutterer at who-t.net
Mon Jul 13 20:41:29 PDT 2015


Rather than magic percentages of the touchpad axis ranges, make it a fixed
size of 7mm. Except on synaptics touchpads, because they won't give us the
actual axis range but rather the "typical bezel limits".

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-mt-touchpad-edge-scroll.c | 25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c
index ade55e0..96fbca6 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -287,30 +287,11 @@ int
 tp_edge_scroll_init(struct tp_dispatch *tp, struct evdev_device *device)
 {
 	struct tp_touch *t;
-	int width, height;
 	int edge_width, edge_height;
 
-	width = device->abs.dimensions.x;
-	height = device->abs.dimensions.y;
-
-	switch (tp->model) {
-	case MODEL_ALPS:
-		edge_width = width * .15;
-		edge_height = height * .15;
-		break;
-	case MODEL_APPLETOUCH: /* unibody are all clickpads, so N/A */
-		edge_width = width * .085;
-		edge_height = height * .085;
-		break;
-	default:
-		/* For elantech and synaptics, note for lenovo #40 series,
-		 * e.g. the T440s min/max are the absolute edges, not the
-		 * recommended ones as usual with synaptics.
-		 */
-		edge_width = width * .04;
-		edge_height = height * .054;
-		break;
-	}
+	/* 7mm edge size */
+	edge_width = device->abs.absinfo_x->resolution * 7;
+	edge_height = device->abs.absinfo_y->resolution * 7;
 
 	tp->scroll.right_edge = device->abs.absinfo_x->maximum - edge_width;
 	tp->scroll.bottom_edge = device->abs.absinfo_y->maximum - edge_height;
-- 
2.4.3



More information about the wayland-devel mailing list