]> git.mdlowis.com Git - proto/labwc.git/commitdiff
rcxml: revise drag-lock behavior and option names
authortokyo4j <hrak1529@gmail.com>
Mon, 30 Jun 2025 07:42:45 +0000 (16:42 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Mon, 30 Jun 2025 18:00:55 +0000 (03:00 +0900)
This revises the changes done in 22d319c:
- Cancel defaulting to <dragLock>sticky<dragLock>. So labwc now disables
  drag-lock by default, as libinput does.
- Update the options from [yes|no|sticky] to [timeout|no|yes] to
  emphasize that the "sticky" mode (now "yes") is recommended when using
  drag-lock.

docs/labwc-config.5.scd
docs/rc.xml.all
src/config/libinput.c
src/config/rcxml.c

index 97cca8ea11d13cabebaea610342df0921a554368..fcca237495b04c8bb08a238e6695dfb41dd6fc76 100644 (file)
@@ -965,7 +965,7 @@ extending outward from the snapped edge.
     <tap>yes</tap>
     <tapButtonMap></tapButtonMap>
     <tapAndDrag></tapAndDrag>
-    <dragLock>sticky</dragLock>
+    <dragLock></dragLock>
     <threeFingerDrag></threeFingerDrag>
     <middleEmulation></middleEmulation>
     <disableWhileTyping></disableWhileTyping>
@@ -1035,11 +1035,13 @@ extending outward from the snapped edge.
        Enable or disable tap-and-drag for this category. Tap-and-drag processes
        a tap immediately followed by a finger down as the start of a drag.
 
-*<libinput><device><dragLock>* [yes|no|sticky]
+*<libinput><device><dragLock>* [yes|no|timeout]
        Enable or disable drag lock for this category. Drag lock ignores a temporary
-       release of a finger during tap-and-dragging. Both *yes* and *sticky* enable
-       drag lock, but if *yes* is set, the drag lock expires after a timeout.
-       Default is *sticky*.
+       release of a finger during tap-and-dragging.
+
+       *timeout* also enables drag lock, but with a timeout: if your fingers are
+       released for a certain amount of time, the drag gesture is cancelled.
+       In libinput < 1.27, the behavior of *yes* is equivalent to *timeout*.
 
 *<libinput><device><threeFingerDrag>* [yes|no|3|4]
        Enable or disable the three-finger drag feature. When enabled, three
index f9fc6eaefe8bcafb58710cc884e8b7d47a7ece71..baffc84c7ab9906f20431a0540db4203b0690fd5 100644 (file)
       <tap>yes</tap>
       <tapButtonMap></tapButtonMap>
       <tapAndDrag></tapAndDrag>
-      <dragLock>sticky</dragLock>
+      <dragLock></dragLock>
       <threeFingerDrag></threeFingerDrag>
       <middleEmulation></middleEmulation>
       <disableWhileTyping></disableWhileTyping>
index d6179d0f768a6070ccf04880f6b73156b24c9e59..c76a9ff924d72c930d95d2a47341c55337513e8c 100644 (file)
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <string.h>
 #include <strings.h>
-#include "config.h"
 #include "common/mem.h"
 #include "common/list.h"
 #include "common/string-helpers.h"
@@ -19,11 +18,7 @@ libinput_category_init(struct libinput_category *l)
        l->tap = LIBINPUT_CONFIG_TAP_ENABLED;
        l->tap_button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
        l->tap_and_drag = -1;
-#if HAVE_LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY
-       l->drag_lock = LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY;
-#else
        l->drag_lock = -1;
-#endif
        l->three_finger_drag = -1;
        l->accel_profile = -1;
        l->middle_emu = -1;
index 39dec8863ce0fa8f07809c9ac9e3bba12db14ee0..cc207603b376fe1c2e02804e259cf10cf1cf6037 100644 (file)
@@ -780,23 +780,23 @@ fill_libinput_category(char *nodename, char *content, struct parser_state *state
                        ? LIBINPUT_CONFIG_DRAG_ENABLED
                        : LIBINPUT_CONFIG_DRAG_DISABLED;
        } else if (!strcasecmp(nodename, "dragLock")) {
-               if (!strcasecmp(content, "sticky")) {
-#if HAVE_LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY
+               if (!strcasecmp(content, "timeout")) {
+                       /* "timeout" enables drag-lock with timeout */
                        state->current_libinput_category->drag_lock =
-                               LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY;
-#else
-                       wlr_log(WLR_ERROR, "<dragLock>sticky</dragLock> is"
-                               " only supported in libinput >= 1.27");
-#endif
+                               LIBINPUT_CONFIG_DRAG_LOCK_ENABLED;
                        return;
                }
                int ret = parse_bool(content, -1);
                if (ret < 0) {
                        return;
                }
-               state->current_libinput_category->drag_lock = ret
-                       ? LIBINPUT_CONFIG_DRAG_LOCK_ENABLED
-                       : LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
+               /* "yes" enables drag-lock, without timeout if libinput >= 1.27 */
+               int enabled = LIBINPUT_CONFIG_DRAG_LOCK_ENABLED;
+#if HAVE_LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY
+               enabled = LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY;
+#endif
+               state->current_libinput_category->drag_lock = ret ?
+                       enabled : LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
        } else if (!strcasecmp(nodename, "threeFingerDrag")) {
 #if HAVE_LIBINPUT_CONFIG_3FG_DRAG_ENABLED_3FG
                if (!strcmp(content, "3")) {