diff options
Diffstat (limited to 'src/input/mod.rs')
| -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); + } + } } } |
