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 {
2571 AxisSource::Finger => self.niri.config.borrow().input.touchpad.scroll_factor,2571 AxisSource::Finger => self.niri.config.borrow().input.touchpad.scroll_factor,
2572 _ => None,2572 _ => None,
2573 };2573 };
2574+ let scroll_factor = scroll_factor.map(|x| x.0).unwrap_or(1.);
2575+
2574 let window_scroll_factor = pointer2576 let window_scroll_factor = pointer
2575 .current_focus()2577 .current_focus()
2576 .map(|focused| self.niri.find_root_shell_surface(&focused))2578 .map(|focused| self.niri.find_root_shell_surface(&focused))
2577 .and_then(|root| self.niri.layout.find_window_and_output(&root).unzip().0)2579 .and_then(|root| self.niri.layout.find_window_and_output(&root).unzip().0)
2578 .and_then(|window| window.rules().scroll_factor);2580 .and_then(|window| window.rules().scroll_factor);
2579- let scroll_factor =2581+ let scroll_factor = scroll_factor * window_scroll_factor.unwrap_or(1.);
2580- scroll_factor.map(|x| x.0).unwrap_or(1.) * window_scroll_factor.unwrap_or(1.);
2581 2582
2582 let horizontal_amount = horizontal_amount.unwrap_or_else(|| {2583 let horizontal_amount = horizontal_amount.unwrap_or_else(|| {
2583 // Winit backend, discrete scrolling.2584 // Winit backend, discrete scrolling.