touchpad: increase the jump detection interval to 30ms
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 25 Nov 2020 03:26:16 +0000 (13:26 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 14 Dec 2020 09:32:13 +0000 (09:32 +0000)
On serial touchpads it's common enough that frames slow down tofrom the usual
12ms to 24ms. That's too close to our 25ms cutoff so if we have a minor delay,
we end up missing out on jump detection.

Fixes #541

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad.c

index 1608e7934179354ad30a62833ee3c79a6b93ee9e..56ab2ca6ace056f23959cfc72316b9d9c7c7cadd 100644 (file)
@@ -1534,10 +1534,10 @@ tp_detect_jumps(const struct tp_dispatch *tp,
        if (tp->device->model_flags & EVDEV_MODEL_TEST_DEVICE)
                reference_interval = tdelta;
 
-       /* If the last frame is more than 25ms ago, we have irregular
+       /* If the last frame is more than 30ms ago, we have irregular
         * frames, who knows what's a pointer jump here and what's
         * legitimate movement.... */
-       if (tdelta > 2 * reference_interval || tdelta == 0)
+       if (tdelta > 2.5 * reference_interval || tdelta == 0)
                return false;
 
        /* We historically expected ~12ms frame intervals, so the numbers