[PATCH libinput] touchpad: disable tap drag lock by default
Hans de Goede
hdegoede at redhat.com
Fri Jun 26 01:19:18 PDT 2015
Hi,
On 26-06-15 08:49, Peter Hutterer wrote:
> Similar to tapping, it's a feature that is useful but confusing if a user
> doesn't know it exists. It makes the touchpad appear laggy and slow to react
> in the best case, or appear like a stuck button in the worst case.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
LGTM:
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Regards,
Hans
> ---
> diff of the test is a bit confusing, but i renamed _enabled to _disabled and
> _disabled to _unavailable. Should be a 4-line diff...
>
> src/evdev-mt-touchpad-tap.c | 2 +-
> test/touchpad-tap.c | 62 ++++++++++++++++++++++-----------------------
> 2 files changed, 32 insertions(+), 32 deletions(-)
>
> diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c
> index 40d431a..7f241de 100644
> --- a/src/evdev-mt-touchpad-tap.c
> +++ b/src/evdev-mt-touchpad-tap.c
> @@ -880,7 +880,7 @@ tp_tap_config_get_draglock_enabled(struct libinput_device *device)
> static inline enum libinput_config_drag_lock_state
> tp_drag_lock_default(struct evdev_device *device)
> {
> - return LIBINPUT_CONFIG_DRAG_LOCK_ENABLED;
> + return LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
> }
>
> static enum libinput_config_drag_lock_state
> diff --git a/test/touchpad-tap.c b/test/touchpad-tap.c
> index d04feb4..c021f1d 100644
> --- a/test/touchpad-tap.c
> +++ b/test/touchpad-tap.c
> @@ -1699,35 +1699,6 @@ START_TEST(touchpad_tap_invalid)
> }
> END_TEST
>
> -START_TEST(touchpad_drag_lock_default_enabled)
> -{
> - struct litest_device *dev = litest_current_device();
> - struct libinput_device *device = dev->libinput_device;
> - enum libinput_config_status status;
> -
> - ck_assert_int_eq(libinput_device_config_tap_get_drag_lock_enabled(device),
> - LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
> - ck_assert_int_eq(libinput_device_config_tap_get_default_drag_lock_enabled(device),
> - LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
> -
> - status = libinput_device_config_tap_set_drag_lock_enabled(device,
> - LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
> - ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
> -
> - status = libinput_device_config_tap_set_drag_lock_enabled(device,
> - LIBINPUT_CONFIG_DRAG_LOCK_DISABLED);
> - ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
> -
> - status = libinput_device_config_tap_set_drag_lock_enabled(device,
> - LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
> - ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
> -
> - status = libinput_device_config_tap_set_drag_lock_enabled(device,
> - 3);
> - ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID);
> -}
> -END_TEST
> -
> START_TEST(touchpad_drag_lock_default_disabled)
> {
> struct litest_device *dev = litest_current_device();
> @@ -1741,6 +1712,35 @@ START_TEST(touchpad_drag_lock_default_disabled)
>
> status = libinput_device_config_tap_set_drag_lock_enabled(device,
> LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
> + ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
> +
> + status = libinput_device_config_tap_set_drag_lock_enabled(device,
> + LIBINPUT_CONFIG_DRAG_LOCK_DISABLED);
> + ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
> +
> + status = libinput_device_config_tap_set_drag_lock_enabled(device,
> + LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
> + ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
> +
> + status = libinput_device_config_tap_set_drag_lock_enabled(device,
> + 3);
> + ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID);
> +}
> +END_TEST
> +
> +START_TEST(touchpad_drag_lock_default_unavailable)
> +{
> + struct litest_device *dev = litest_current_device();
> + struct libinput_device *device = dev->libinput_device;
> + enum libinput_config_status status;
> +
> + ck_assert_int_eq(libinput_device_config_tap_get_drag_lock_enabled(device),
> + LIBINPUT_CONFIG_DRAG_LOCK_DISABLED);
> + ck_assert_int_eq(libinput_device_config_tap_get_default_drag_lock_enabled(device),
> + LIBINPUT_CONFIG_DRAG_LOCK_DISABLED);
> +
> + status = libinput_device_config_tap_set_drag_lock_enabled(device,
> + LIBINPUT_CONFIG_DRAG_LOCK_ENABLED);
> ck_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED);
>
> status = libinput_device_config_tap_set_drag_lock_enabled(device,
> @@ -1809,7 +1809,7 @@ litest_setup_tests(void)
> litest_add("touchpad:tap", clickpad_1fg_tap_click, LITEST_CLICKPAD, LITEST_ANY);
> litest_add("touchpad:tap", clickpad_2fg_tap_click, LITEST_CLICKPAD, LITEST_SINGLE_TOUCH|LITEST_APPLE_CLICKPAD);
>
> - litest_add("touchpad:tap", touchpad_drag_lock_default_enabled, LITEST_TOUCHPAD, LITEST_ANY);
> - litest_add("touchpad:tap", touchpad_drag_lock_default_disabled, LITEST_ANY, LITEST_TOUCHPAD);
> + litest_add("touchpad:tap", touchpad_drag_lock_default_disabled, LITEST_TOUCHPAD, LITEST_ANY);
> + litest_add("touchpad:tap", touchpad_drag_lock_default_unavailable, LITEST_ANY, LITEST_TOUCHPAD);
>
> }
>
More information about the wayland-devel
mailing list