aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-04-20 12:37:31 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-04-25 02:00:18 -0700
commitee4c5e23ab93d606d30e64ccf1c6cf3d9367ad91 (patch)
treef1afa1f29f24ed2b7e215fe85fccef02bb4b84e7
parentffd6acc0aabddf6e7a647aeadc5b656125267e33 (diff)
downloadniri-ee4c5e23ab93d606d30e64ccf1c6cf3d9367ad91.tar.gz
niri-ee4c5e23ab93d606d30e64ccf1c6cf3d9367ad91.tar.bz2
niri-ee4c5e23ab93d606d30e64ccf1c6cf3d9367ad91.zip
Reformat scroll factor computation
-rw-r--r--src/input/mod.rs5
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.