rcxml: revise drag-lock behavior and option names

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.
This commit is contained in:
tokyo4j 2025-06-30 16:42:45 +09:00 committed by Hiroaki Yamamoto
parent e365d5eaf0
commit d7fd23e52d
4 changed files with 18 additions and 21 deletions

View 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")) {