[PATCH synaptics] Stop coasting when two-finger scroll begins

Pierre Lulé pierre at lule.fr
Mon Apr 16 03:01:56 PDT 2012


There is currently a problem that can lead the coasting to continue while scrolling in a particular situation :
with
 Option "VertTwoFingerScroll" "on"
 Option "CornerCoasting" "0"
 Option "CoastingSpeed" "10"
 Option "CoastingFriction" "50"
 Option "CornerCoasting" "0"
If you scroll down with two finger then raise a finger, coasting will start. But if you put down that finger and try to
scroll up, the inertia will still scroll down while you scroll up. This can look like a very particular situation, but
happens to me often while scrolling in a big document.

This (awfully simple) patch stop coasting when detecting two-finger scroll.

Signed-off-by: Pierre Lulé <pierre at lule.fr>
---
 src/synaptics.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/synaptics.c b/src/synaptics.c
index 40478ec..2ea7375 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2418,6 +2418,7 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
 	    if (hw->numFingers == 2) {
 		if (!priv->vert_scroll_twofinger_on &&
 		    (para->scroll_twofinger_vert) && (para->scroll_dist_vert != 0)) {
+		    stop_coasting(priv);
 		    priv->vert_scroll_twofinger_on = TRUE;
 		    priv->vert_scroll_edge_on = FALSE;
 		    priv->scroll.last_y = hw->y;
@@ -2425,6 +2426,7 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
 		}
 		if (!priv->horiz_scroll_twofinger_on &&
 		    (para->scroll_twofinger_horiz) && (para->scroll_dist_horiz != 0)) {
+		    stop_coasting(priv);
 		    priv->horiz_scroll_twofinger_on = TRUE;
 		    priv->horiz_scroll_edge_on = FALSE;
 		    priv->scroll.last_x = hw->x;
-- 
1.7.10



More information about the xorg-devel mailing list