forge
Explore
Log in

Don't you dare go Hollow

Reformat scroll factor computation

Browse files at this commit

ee4c5e23ab93d606d30e64ccf1c6cf3d9367ad91Ivan MolodetskikhParent: ffd6acc
src/input/mod.rsmodified+3 -2
@@ -2571,13 +2571,14 @@ impl State {
25712571 AxisSource::Finger => self.niri.config.borrow().input.touchpad.scroll_factor,
25722572 _ => None,
25732573 };
2574+ let scroll_factor = scroll_factor.map(|x| x.0).unwrap_or(1.);
2575+
25742576 let window_scroll_factor = pointer
25752577 .current_focus()
25762578 .map(|focused| self.niri.find_root_shell_surface(&focused))
25772579 .and_then(|root| self.niri.layout.find_window_and_output(&root).unzip().0)
25782580 .and_then(|window| window.rules().scroll_factor);
2579- let scroll_factor =
2580- scroll_factor.map(|x| x.0).unwrap_or(1.) * window_scroll_factor.unwrap_or(1.);
2581+ let scroll_factor = scroll_factor * window_scroll_factor.unwrap_or(1.);
25812582
25822583 let horizontal_amount = horizontal_amount.unwrap_or_else(|| {
25832584 // Winit backend, discrete scrolling.