1
0
Fork 0
forked from wry/wry

autocommit 2022-04-10 01:54:16 CEST

This commit is contained in:
Julian Orth 2022-04-10 01:54:16 +02:00
parent befd5e99b2
commit af152f7f3e
6 changed files with 49 additions and 5 deletions

View file

@ -14,6 +14,7 @@ use {
},
std::rc::Rc,
};
use crate::ifs::wl_seat::PX_PER_SCROLL;
macro_rules! unpack {
($slf:expr, $ev:expr) => {{
@ -121,7 +122,6 @@ impl MetalBackend {
}
fn handle_pointer_axis(self: &Rc<Self>, event: LibInputEvent, source: AxisSource) {
const PX_PER_SCROLL: f64 = 15.0;
const ONE_TWENTRY: f64 = 120.0;
let (event, dev) = unpack!(self, event, pointer_event);
let axes = [

View file

@ -54,6 +54,7 @@ use {
},
thiserror::Error,
};
use crate::ifs::wl_seat::PX_PER_SCROLL;
#[derive(Debug, Error)]
pub enum XBackendError {
@ -729,7 +730,7 @@ impl XBackendData {
};
seat.mouse_event(InputEvent::AxisSource(AxisSource::Wheel));
seat.mouse_event(InputEvent::AxisDiscrete(val, axis));
seat.mouse_event(InputEvent::Axis(Fixed::from_int(val * 15), axis));
seat.mouse_event(InputEvent::Axis((val as f64 * PX_PER_SCROLL).into(), axis));
seat.mouse_event(InputEvent::Frame);
}
} else {