Skip to content

input: support explicit modes (timeout, sticky) for drag-lock#3943

Open
zzzsyyy wants to merge 1 commit into
niri-wm:mainfrom
zzzsyyy:draglock
Open

input: support explicit modes (timeout, sticky) for drag-lock#3943
zzzsyyy wants to merge 1 commit into
niri-wm:mainfrom
zzzsyyy:draglock

Conversation

@zzzsyyy
Copy link
Copy Markdown
Contributor

@zzzsyyy zzzsyyy commented Apr 30, 2026

Previously, drag-lock was a bool flag that enabled the timeout-based drag lock in libinput. However, libinput also supports a "sticky" mode.

This commit changes the drag-lock config to accept an optional string argument:

  • drag-lock "timeout"
  • drag-lock "sticky"

upstream recommends "sticky" as the preferred
default mode for drag lock (see: https://lists.freedesktop.org/archives/wayland-devel/2024-November/043860.html).

but keeping "timeout" as the implicit default here can avoid breaking
users' existing muscle memory. should we change it to sticky?

Previously, `drag-lock` was a boolean flag that enabled the timeout-based
drag lock in libinput. However, libinput also supports a "sticky" mode.

This commit changes the `drag-lock` config to accept an optional string
argument:
- `drag-lock "timeout"`
- `drag-lock "sticky"`

To maintain backward compatibility, specifying `drag-lock` without an
argument automatically defaults to the `"timeout"` mode, perfectly
preserving the previous behavior for existing configurations.
Comment thread Cargo.toml
git-version = "0.3.9"
glam = "0.32.1"
input = { version = "0.10.0", features = ["libinput_1_21"] }
input = { version = "0.10.0", features = ["libinput_1_27"] }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to bump the requirement? How's distro support?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the sticky draglock mode was only added in libinput 1.27, and most current stable distros released already ship libinput 1.27 or newer, maybe we need a runtime checker?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which distros in particular and which not?

Copy link
Copy Markdown
Contributor Author

@zzzsyyy zzzsyyy Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fedora 43/44, Ubuntu 26.04 LTS, Debian 13 Stable/Testing are, while Ubuntu 24.04 LTS, Debian 12 not

ref: repology

@Sempyos Sempyos added area:input Keyboard, mouse, touchpad, tablet, gestures, pointer pr kind:feature New features and functionality area:config Config parsing, default config, new settings labels Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Config parsing, default config, new settings area:input Keyboard, mouse, touchpad, tablet, gestures, pointer pr kind:feature New features and functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants