From f08167c877227b2c9e0b59e7d38d072bdcd944a5 Mon Sep 17 00:00:00 2001 From: may <63159454+m4rch3n1ng@users.noreply.github.com> Date: Sun, 15 Jun 2025 11:45:06 +0200 Subject: input: add sticky option for drag_lock (#10702) * allow configuring the sticky option for `drag_lock` * enable sticky drag_lock by default as recommended by libinput recommended here: https://lists.freedesktop.org/archives/wayland-devel/2024-November/043860.html --- src/managers/input/InputManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 8d9d40b2..e0957abf 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1233,10 +1233,10 @@ void CInputManager::setPointerConfigs() { else libinput_device_config_tap_set_drag_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_DRAG_ENABLED); - if (g_pConfigManager->getDeviceInt(devname, "drag_lock", "input:touchpad:drag_lock") == 0) - libinput_device_config_tap_set_drag_lock_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); - else - libinput_device_config_tap_set_drag_lock_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED); + const auto TAP_DRAG_LOCK = g_pConfigManager->getDeviceInt(devname, "drag_lock", "input:touchpad:drag_lock"); + if (TAP_DRAG_LOCK >= 0 && TAP_DRAG_LOCK <= 2) { + libinput_device_config_tap_set_drag_lock_enabled(LIBINPUTDEV, static_cast(TAP_DRAG_LOCK)); + } if (libinput_device_config_tap_get_finger_count(LIBINPUTDEV)) // this is for tapping (like on a laptop) libinput_device_config_tap_set_enabled(LIBINPUTDEV, -- cgit v1.2.3