Skip to content

Commit

Permalink
Allow disabling tap-and-drag
Browse files Browse the repository at this point in the history
Similar to #1088, this adds a new
touchpad `drag` configuration option that configures tap-and-drag
behavior.

Currently tap-and-drag is always enabled when the `tap` setting is
enabled, but other compositors allow setting this separately.
  • Loading branch information
alexdavid committed Feb 9, 2025
1 parent 397e704 commit f772d6e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions niri-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ pub struct Touchpad {
#[knuffel(child)]
pub dwtp: bool,
#[knuffel(child)]
pub drag: bool,
#[knuffel(child)]
pub drag_lock: bool,
#[knuffel(child)]
pub natural_scroll: bool,
Expand Down Expand Up @@ -3612,6 +3614,7 @@ mod tests {
tap: true,
dwt: true,
dwtp: true,
drag: false,
drag_lock: false,
click_method: Some(ClickMethod::Clickfinger),
natural_scroll: false,
Expand Down
1 change: 1 addition & 0 deletions resources/default-config.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ input {
tap
// dwt
// dwtp
// drag
// drag-lock
natural-scroll
// accel-speed 0.2
Expand Down
1 change: 1 addition & 0 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3253,6 +3253,7 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input::
let _ = device.config_tap_set_enabled(c.tap);
let _ = device.config_dwt_set_enabled(c.dwt);
let _ = device.config_dwtp_set_enabled(c.dwtp);
let _ = device.config_tap_set_drag_enabled(c.drag);
let _ = device.config_tap_set_drag_lock_enabled(c.drag_lock);
let _ = device.config_scroll_set_natural_scroll_enabled(c.natural_scroll);
let _ = device.config_accel_set_speed(c.accel_speed);
Expand Down
2 changes: 2 additions & 0 deletions wiki/Configuration:-Input.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ input {
tap
// dwt
// dwtp
// drag
// drag-lock
natural-scroll
// accel-speed 0.2
Expand Down Expand Up @@ -182,6 +183,7 @@ Settings specific to `touchpad`s:
- `tap`: tap-to-click.
- `dwt`: disable-when-typing.
- `dwtp`: disable-when-trackpointing.
- `drag`: tap-to-drag
- `drag-lock`: if set, lifting the finger off for a short time while dragging will not drop the dragged item. See the [libinput documentation](https://wayland.freedesktop.org/libinput/doc/latest/tapping.html#tap-and-drag).
- `tap-button-map`: can be `left-right-middle` or `left-middle-right`, controls which button corresponds to a two-finger tap and a three-finger tap.
- `click-method`: can be `button-areas` or `clickfinger`, changes the [click method](https://wayland.freedesktop.org/libinput/doc/latest/clickpad-softbuttons.html).
Expand Down

0 comments on commit f772d6e

Please sign in to comment.