Fix vertical wheel binds on winit

This commit is contained in:
Ivan Molodetskikh
2024-03-23 09:00:55 +04:00
parent b09dbb80c7
commit c66319314e
+12 -2
View File
@@ -1121,6 +1121,10 @@ impl State {
let comp_mod = self.backend.mod_key();
let mods = self.niri.seat.get_keyboard().unwrap().modifier_state();
// Winit sends scroll events where both directions are set at once, so we can't early
// return after handling just one.
let mut handled = false;
if let Some(v120) = horizontal_amount_v120 {
let config = self.niri.config.borrow();
let bindings = &config.binds;
@@ -1144,7 +1148,8 @@ impl State {
self.handle_bind(left.clone());
}
}
return;
handled = true;
} else {
self.niri.horizontal_wheel_tracker.reset();
}
@@ -1171,11 +1176,16 @@ impl State {
self.handle_bind(up.clone());
}
}
return;
handled = true;
} else {
self.niri.vertical_wheel_tracker.reset();
}
}
if handled {
return;
}
}
let horizontal_amount = event.amount(Axis::Horizontal).unwrap_or_else(|| {