Limit the movement size for avoiding the unexpected pointer jumps.

Signed-off-by: Takashi Iwai <[email protected]>
---
 src/synaptics.c    |   10 ++++++++++
 src/synapticsstr.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/synaptics.c b/src/synaptics.c
index 3ba918a..bd52730 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -467,6 +467,8 @@ static void set_default_parameters(InputInfoPtr pInfo)
     edgeMotionMaxSpeed = diag * .080;
     accelFactor = 200.0 / diag; /* trial-and-error */
 
+    priv->move_ptr_threshold = width / 5;
+
     range = priv->maxp - priv->minp;
 
     /* scaling based on defaults and a pressure of 256 */
@@ -1949,6 +1951,14 @@ ComputeDeltas(SynapticsPrivate *priv, const struct 
SynapticsHwState *hw,
            break;
        }
     }
+
+    if (moving_state && priv->count_packet_finger > 0 &&
+       priv->move_ptr_threshold > 0 ) {
+       int d = move_distance(HIST(0).x - hw->x, HIST(0).y - hw->y);
+       if (d > priv->move_ptr_threshold)
+           priv->count_packet_finger = 0; /* to avoid unexpected jumps */
+    }
+
     if (inside_area && moving_state && !priv->palm &&
        !priv->vert_scroll_edge_on && !priv->horiz_scroll_edge_on &&
        !priv->vert_scroll_twofinger_on && !priv->horiz_scroll_twofinger_on &&
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 44140f2..44925e5 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -245,6 +245,7 @@ typedef struct _SynapticsPrivateRec
     unsigned int clickpad_threshold;
     int clickpad_dx, clickpad_dy;
     struct SynapticsHwState prev_hw;   /* previous h/w state (for clickpad) */
+    int move_ptr_threshold;
     int prop_change_pending;
     Bool led_touch_state;
     Bool led_tapped;
-- 
1.7.3.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to