diff options
| author | may <63159454+m4rch3n1ng@users.noreply.github.com> | 2025-06-15 11:45:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-15 11:45:06 +0200 |
| commit | f08167c877227b2c9e0b59e7d38d072bdcd944a5 (patch) | |
| tree | 1c655f727b71f287efa272999fdee598162650a6 /src/managers/input/InputManager.cpp | |
| parent | ad85406220d88c3de9ceba32f17a25caf101bb45 (diff) | |
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
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<libinput_config_drag_lock_state>(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, |
