diff options
| author | chillinbythetree <141879625+chillinbythetree@users.noreply.github.com> | 2024-10-17 01:43:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-17 05:43:47 +0000 |
| commit | a480087618ea8835663ae0eb7da3bd066c1941d0 (patch) | |
| tree | 115d245d1dfaed7e3303be1154eb75983afa3757 /src | |
| parent | 84655d3b2627687e14431adb49450cd6af1de40f (diff) | |
| download | niri-a480087618ea8835663ae0eb7da3bd066c1941d0.tar.gz niri-a480087618ea8835663ae0eb7da3bd066c1941d0.tar.bz2 niri-a480087618ea8835663ae0eb7da3bd066c1941d0.zip | |
Add scroll-button property for Touchpad, Mouse, Trackpoint, Trackball (#744)
Diffstat (limited to 'src')
| -rw-r--r-- | src/input/mod.rs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index ee201922..92475d8e 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -2657,8 +2657,20 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: if let Some(method) = c.scroll_method { let _ = device.config_scroll_set_method(method.into()); + + if method == niri_config::ScrollMethod::OnButtonDown { + if let Some(button) = c.scroll_button { + let _ = device.config_scroll_set_button(button); + } + } } else if let Some(default) = device.config_scroll_default_method() { let _ = device.config_scroll_set_method(default); + + if default == input::ScrollMethod::OnButtonDown { + if let Some(button) = c.scroll_button { + let _ = device.config_scroll_set_button(button); + } + } } if let Some(tap_button_map) = c.tap_button_map { @@ -2713,8 +2725,20 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: if let Some(method) = c.scroll_method { let _ = device.config_scroll_set_method(method.into()); + + if method == niri_config::ScrollMethod::OnButtonDown { + if let Some(button) = c.scroll_button { + let _ = device.config_scroll_set_button(button); + } + } } else if let Some(default) = device.config_scroll_default_method() { let _ = device.config_scroll_set_method(default); + + if default == input::ScrollMethod::OnButtonDown { + if let Some(button) = c.scroll_button { + let _ = device.config_scroll_set_button(button); + } + } } } @@ -2735,6 +2759,24 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: } else if let Some(default) = device.config_accel_default_profile() { let _ = device.config_accel_set_profile(default); } + + if let Some(method) = c.scroll_method { + let _ = device.config_scroll_set_method(method.into()); + + if method == niri_config::ScrollMethod::OnButtonDown { + if let Some(button) = c.scroll_button { + let _ = device.config_scroll_set_button(button); + } + } + } else if let Some(default) = device.config_scroll_default_method() { + let _ = device.config_scroll_set_method(default); + + if default == input::ScrollMethod::OnButtonDown { + if let Some(button) = c.scroll_button { + let _ = device.config_scroll_set_button(button); + } + } + } } if is_trackpoint { @@ -2756,8 +2798,20 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: if let Some(method) = c.scroll_method { let _ = device.config_scroll_set_method(method.into()); + + if method == niri_config::ScrollMethod::OnButtonDown { + if let Some(button) = c.scroll_button { + let _ = device.config_scroll_set_button(button); + } + } } else if let Some(default) = device.config_scroll_default_method() { let _ = device.config_scroll_set_method(default); + + if default == input::ScrollMethod::OnButtonDown { + if let Some(button) = c.scroll_button { + let _ = device.config_scroll_set_button(button); + } + } } } |
