While preparing and testing some changes in ubcmtp I found a bug in
wsconscomm that may affect two-finger touches on "noisy" MT devices, that
is, on devices that constantly report small deltas of the touch positions
even if there is no noticeable movement.

Whenever the contact count or the pointer-controlling touch changes,
wsmouse will generate a TOUCH_RESET event, which signals that there is a
coordinate update that may not correspond to a movement on the touchpad.
The wsconscomm handler ensures that in this case the driver doesn't
trigger pointer movement. If scrolling is active, it also adjusts the
scroll coordinates and the "move history" to the new position (this is
necessary because the driver computes its scroll deltas independently of
the motion deltas).

The hysteresis coordinates will need a similar adjustment. If it works
with stale coordinates, the filter may produce an output that differs
from its input by an amount that is equal to the hysteresis threshold.
If you have a "noisy" device and put two fingers on its surface without
moving them, pointer control can quickly switch back and forth, and the
deltas add up quickly to visible changes of the scroll position.

The good news is that the fix is much shorter than its explanation.

OK?


Index: src/wsconscomm.c
===================================================================
RCS file: /cvs/xenocara/driver/xf86-input-synaptics/src/wsconscomm.c,v
retrieving revision 1.16
diff -u -p -r1.16 wsconscomm.c
--- src/wsconscomm.c    12 Sep 2016 22:12:44 -0000      1.16
+++ src/wsconscomm.c    6 Mar 2017 18:37:41 -0000
@@ -252,6 +252,9 @@ WSConsReadHwState(InputInfoPtr pInfo,
             if (reset) {
                 /* Ensure that pointer motion stops. */
                 priv->count_packet_finger = 0;
+                /* Don't use stale coordinates for filtering. */
+                priv->hyst_center_x = hw->x;
+                priv->hyst_center_y = hw->y;
                 if (priv->vert_scroll_twofinger_on
                     || priv->horiz_scroll_twofinger_on) {
                     WSConsAdjustScrollCoords(priv, hw);

Reply via email to