[PATCH synaptics] Add movement constraints to clickpads to prevent cursor jumps
gabriele.mzt at gmail.com
Fri Jun 13 02:22:08 PDT 2014
It appears that 71652fe ("Ignore motion the first X ms after a
clickpad click") is not enough to prevent unwanted cursor jumps when
two different fingers are used to respectively move the cursor and
click. The jumps are due to the small delay between the actual click and
the moment the finger is placed on the clickpad. Because of this delay,
the two events are sometimes seen as independent from each other and
since the finger detection happens first, the motion is not ignored.
Add a constraint on the distance covered to prevent jumps.
The difference between two detections along the x axis has to be
smaller than 1/4 of the clickpad width and smaller than 1/4 of the
height along the y axis.
Signed-off-by: Gabriele Mazzotta <gabriele.mzt at gmail.com>
This patch was tested on a Dell XPS13 9333. I don't know if 1/4 of the
width and 1/4 of the height are good constraints, on my laptop I couldn't
notice any side effect even with stricter constraints.
src/synaptics.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/synaptics.c b/src/synaptics.c
index 32edce5..b9da62c 100644
@@ -3233,6 +3233,9 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
buttons |= tap_mask;
+ if (para->clickpad && abs(dx) > priv->maxx/4 && abs(dy) > priv->maxy/4)
+ ignore_motion = TRUE;
/* Post events */
if (finger >= FS_TOUCHED && (dx || dy) && !ignore_motion)
xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
More information about the xorg-devel