summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-12-02 11:35:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-12-21 13:30:01 +1000
commitd0ba1e2b383acaac8a31a1ded7d3039bcd161db3 (patch)
tree997964c678a5ddc79a8b6a543b32dcc4a8f91cb8
parentacbbe882a2938183da7f4169a289e3589553374c (diff)
touchpad: reduce the initial timeout for tapping after touch
This is the timeout before we decide "this is just a finger down, not a tap". Until this timeout is hit a finger's movement is filtered. To allow for a more responsive touchpad, we want that timeout as short as possible. Event analysis from several users showed that 95% of the touches are less than 100ms long. Reducing the threshold should have almost no impact on most tapping users but improves the reaction time of the pointer for normal movements. For a more details see: http://who-t.blogspot.com/2016/12/libinput-touchpad-tap-analysis.html Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--src/evdev-mt-touchpad-tap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c
index cb4abf24..b65bac4f 100644
--- a/src/evdev-mt-touchpad-tap.c
+++ b/src/evdev-mt-touchpad-tap.c
@@ -33,6 +33,7 @@
#include "evdev-mt-touchpad.h"
+#define DEFAULT_TAP_INITIAL_TIMEOUT_PERIOD ms2us(100)
#define DEFAULT_TAP_TIMEOUT_PERIOD ms2us(180)
#define DEFAULT_DRAG_TIMEOUT_PERIOD ms2us(300)
#define DEFAULT_TAP_MOVE_THRESHOLD TP_MM_TO_DPI_NORMALIZED(3)
@@ -127,6 +128,13 @@ tp_tap_notify(struct tp_dispatch *tp,
}
static void
+tp_tap_set_initial_timer(struct tp_dispatch *tp, uint64_t time)
+{
+ libinput_timer_set(&tp->tap.timer,
+ time + DEFAULT_TAP_INITIAL_TIMEOUT_PERIOD);
+}
+
+static void
tp_tap_set_timer(struct tp_dispatch *tp, uint64_t time)
{
libinput_timer_set(&tp->tap.timer, time + DEFAULT_TAP_TIMEOUT_PERIOD);
@@ -155,7 +163,7 @@ tp_tap_idle_handle_event(struct tp_dispatch *tp,
case TAP_EVENT_TOUCH:
tp->tap.state = TAP_STATE_TOUCH;
tp->tap.first_press_time = time;
- tp_tap_set_timer(tp, time);
+ tp_tap_set_initial_timer(tp, time);
break;
case TAP_EVENT_RELEASE:
break;