From 206a4bf441e98b02fa09fefceebffcde1b017793 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 13 Jul 2015 12:56:39 +1000 Subject: [PATCH] touchpad: make the edge-scroll edge 7mm wide Rather than magic percentages of the touchpad axis ranges, make it a fixed size of 7mm. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- 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 aa9197f0..bb3890c1 100644 --- a/src/evdev-mt-touchpad-edge-scroll.c +++ b/src/evdev-mt-touchpad-edge-scroll.c @@ -285,30 +285,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;