diff options
| -rw-r--r-- | src/input/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index 4d077fe0..d9f610be 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -2571,13 +2571,14 @@ impl State { AxisSource::Finger => self.niri.config.borrow().input.touchpad.scroll_factor, _ => None, }; + let scroll_factor = scroll_factor.map(|x| x.0).unwrap_or(1.); + let window_scroll_factor = pointer .current_focus() .map(|focused| self.niri.find_root_shell_surface(&focused)) .and_then(|root| self.niri.layout.find_window_and_output(&root).unzip().0) .and_then(|window| window.rules().scroll_factor); - let scroll_factor = - scroll_factor.map(|x| x.0).unwrap_or(1.) * window_scroll_factor.unwrap_or(1.); + let scroll_factor = scroll_factor * window_scroll_factor.unwrap_or(1.); let horizontal_amount = horizontal_amount.unwrap_or_else(|| { // Winit backend, discrete scrolling. |
