[PATCH synaptics] Add movement constraints to clickpads to prevent cursor jumps
Alexander E. Patrakov
patrakov at gmail.com
Sat Jun 14 04:47:27 PDT 2014
13.06.2014 15:22, Gabriele Mazzotta wrote:
> 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.
See also https://bugs.freedesktop.org/show_bug.cgi?id=76722 for a
similar bug in libinput. In that case, though, I was able to trace it to
a touchpad firmware bug.
> 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.
In my patch for libinput (see the attachment to
I used 1/8 of the diagonal.
> src/synaptics.c | 3 +++
> 1 file changed, 3 insertions(+)
> diff --git a/src/synaptics.c b/src/synaptics.c
> index 32edce5..b9da62c 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -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;
I'd say this is sufficient to fix the original bug that you see.
However, when jumps result from the (*cough* Sony *cough*) hardware
failing to see that the new touch point in fact belongs to a different
finger, just ignoring motion may or may not be sufficient. Are there any
tap-related or other gestures that may be affected by the wrong
assumption that there were no finger-up/finger-down events in the middle
(i.e. that it is the same finger)?
Alexander E. Patrakov
More information about the xorg-devel