From d2200dec0221d36f344b4ca264d92e0816d71e93 Mon Sep 17 00:00:00 2001 From: Velimir Lisec Date: Thu, 30 Apr 2015 11:12:26 +0200 Subject: [PATCH 2/2] Increase drag timeout Curently drag timeout is set to DEFAULT_TAP_TIMEOUT. That is to short. Introduce DEFAULT_DRAG_TIMEOUT and set it to 300 ms. --- src/evdev-mt-touchpad-tap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c index 011abde..f476170 100644 --- a/src/evdev-mt-touchpad-tap.c +++ b/src/evdev-mt-touchpad-tap.c @@ -37,6 +37,7 @@ #define CASE_RETURN_STRING(a) case a: return #a #define DEFAULT_TAP_TIMEOUT_PERIOD 150 +#define DEFAULT_DRAG_TIMEOUT_PERIOD 300 #define DEFAULT_TAP_MOVE_THRESHOLD TP_MM_TO_DPI_NORMALIZED(3) enum tap_event { @@ -130,6 +131,12 @@ tp_tap_set_timer(struct tp_dispatch *tp, uint64_t time) } static void +tp_tap_set_drag_timer(struct tp_dispatch *tp, uint64_t time) +{ + libinput_timer_set(&tp->tap.timer, time + DEFAULT_DRAG_TIMEOUT_PERIOD); +} + +static void tp_tap_clear_timer(struct tp_dispatch *tp) { libinput_timer_cancel(&tp->tap.timer); @@ -382,7 +389,7 @@ tp_tap_dragging_handle_event(struct tp_dispatch *tp, break; case TAP_EVENT_RELEASE: tp->tap.state = TAP_STATE_DRAGGING_WAIT; - tp_tap_set_timer(tp, time); + tp_tap_set_drag_timer(tp, time); break; case TAP_EVENT_MOTION: case TAP_EVENT_TIMEOUT: -- 1.9.1