[PATCH libinput 6/6] touchpad: Increase 2 finger scrolling threshold

Hans de Goede hdegoede at redhat.com
Fri May 23 07:06:27 PDT 2014


With the one px threshold we can easily end up accidentally locking scrolling
to the wrong direction.

As an added benefit a larger threshold also reduces the chance of a second
finger temporarily coming down causing scrolling to start and the first finger
to no longer be seen as the pointer.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/evdev-mt-touchpad.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index e7943f6..4a1bf29 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -464,11 +464,11 @@ tp_post_twofinger_scroll(struct tp_dispatch *tp, uint64_t time)
 	tp_filter_motion(tp, &dx, &dy, time);
 
 	if (tp->scroll.state == SCROLL_STATE_NONE) {
-		/* Require at least one px scrolling to start */
-		if (dy <= -1.0 || dy >= 1.0) {
+		/* Require at least three px scrolling to start */
+		if (dy <= -3.0 || dy >= 3.0) {
 			tp->scroll.state = SCROLL_STATE_SCROLLING;
 			tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL);
-		} else if (dx <= -1.0 || dx >= 1.0) {
+		} else if (dx <= -3.0 || dx >= 3.0) {
 			tp->scroll.state = SCROLL_STATE_SCROLLING;
 			tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL);
 		}
-- 
1.9.3



More information about the wayland-devel mailing list