mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 04:30:06 +01:00
Merge branch 'wip/dwt-timeout-inclusive' into 'main'
touchpad: make the dwt/dwtp timeout inclusive min/max See merge request libinput/libinput!1377
This commit is contained in:
commit
2243b5588c
2 changed files with 4 additions and 4 deletions
|
|
@ -3174,7 +3174,7 @@ tp_dwt_config_set_timeout(struct libinput_device *device, uint64_t timeout)
|
|||
struct evdev_device *evdev = evdev_device(device);
|
||||
struct tp_dispatch *tp = (struct tp_dispatch *)evdev->dispatch;
|
||||
|
||||
if (timeout <= ms2us(100) || timeout >= ms2us(5000))
|
||||
if (timeout < ms2us(100) || timeout > ms2us(5000))
|
||||
return LIBINPUT_CONFIG_STATUS_INVALID;
|
||||
|
||||
tp->dwt.timeout = timeout;
|
||||
|
|
@ -3249,7 +3249,7 @@ tp_dwtp_config_set_timeout(struct libinput_device *device, uint64_t timeout)
|
|||
struct evdev_device *evdev = evdev_device(device);
|
||||
struct tp_dispatch *tp = (struct tp_dispatch *)evdev->dispatch;
|
||||
|
||||
if (timeout <= ms2us(100) || timeout >= ms2us(5000))
|
||||
if (timeout < ms2us(100) || timeout > ms2us(5000))
|
||||
return LIBINPUT_CONFIG_STATUS_INVALID;
|
||||
|
||||
tp->palm.timeout = timeout;
|
||||
|
|
|
|||
|
|
@ -4532,11 +4532,11 @@ START_TEST(touchpad_dwt_config_default_on)
|
|||
litest_assert_int_eq(timeout, 600U);
|
||||
|
||||
/* Too short, too long */
|
||||
status = libinput_device_config_dwt_set_timeout(device, 10);
|
||||
status = libinput_device_config_dwt_set_timeout(device, 99);
|
||||
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID);
|
||||
timeout = libinput_device_config_dwt_get_timeout(device);
|
||||
litest_assert_int_eq(timeout, 600U);
|
||||
status = libinput_device_config_dwt_set_timeout(device, 5000);
|
||||
status = libinput_device_config_dwt_set_timeout(device, 5001);
|
||||
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID);
|
||||
timeout = libinput_device_config_dwt_get_timeout(device);
|
||||
litest_assert_int_eq(timeout, 600U);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue