From c63075febe60edc81d39bab22a77684df129a67d Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Thu, 15 Apr 2010 21:37:24 +0200 Subject: Reset scroll state on finger configuration change When scrolling, the current code remembers how close the movement is to emitting a scroll button, in order to produce a continuous stepping motion. However, when the finger configuration on the trackpad changes, this state should start over again, or the next scolling gesture may scroll prematurely. This patch resets the scrolling state when a change is detected, which fixes the problem. Signed-off-by: Henrik Rydberg --- src/multitouch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/multitouch.c b/src/multitouch.c index cc57cad..a11b8da 100644 --- a/src/multitouch.c +++ b/src/multitouch.c @@ -215,6 +215,12 @@ static void handle_gestures(LocalDevicePtr local, int vswipestep = 1 + vswipe_fraction * get_cap_ysize(caps); int hswipestep = 1 + hswipe_fraction * get_cap_xsize(caps); int i; + if (!gs->same_fingers) { + vscroll = 0; + hscroll = 0; + vswipe = 0; + hswipe = 0; + } for (i = 0; i < DIM_BUTTON; i++) { if (GETBIT(gs->btmask, i)) { xf86PostButtonEvent(local->dev, FALSE, -- cgit v1.2.3