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
This commit is contained in:
may
2025-06-15 11:45:06 +02:00
committed by GitHub
parent ad85406220
commit f08167c877
5 changed files with 12 additions and 11 deletions

View File

@@ -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,