mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 01:10:08 +01:00
touchpad: increase drag timeout
libinput supports lifting a finger during dragging and setting it back down again to continue the drag. Curently the drag timeout is set to DEFAULT_TAP_TIMEOUT. That is to short, when we're dragging the finger needs to have enough time to move from one edge of the touchpad to the other. 180ms is too short for that and causes false timeouts and thus button releases that cancel the drag. Introduce DEFAULT_DRAG_TIMEOUT and set it to 500 ms. Signed-off-by: Velimir Lisec <lisec.velimir@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
182b7b7da9
commit
ff132b2cfb
1 changed files with 8 additions and 1 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#define CASE_RETURN_STRING(a) case a: return #a
|
||||
|
||||
#define DEFAULT_TAP_TIMEOUT_PERIOD 180
|
||||
#define DEFAULT_DRAG_TIMEOUT_PERIOD 500
|
||||
#define DEFAULT_TAP_MOVE_THRESHOLD TP_MM_TO_DPI_NORMALIZED(3)
|
||||
|
||||
enum tap_event {
|
||||
|
|
@ -128,6 +129,12 @@ tp_tap_set_timer(struct tp_dispatch *tp, uint64_t time)
|
|||
libinput_timer_set(&tp->tap.timer, time + DEFAULT_TAP_TIMEOUT_PERIOD);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
@ -380,7 +387,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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue