Add scroll accumulator for seats below version 8
This commit is contained in:
parent
69ed0c0ad4
commit
edf19aae9a
2 changed files with 7 additions and 1 deletions
|
|
@ -1459,7 +1459,11 @@ impl WlSeatGlobal {
|
|||
if p.seat.version >= AXIS_VALUE120_SINCE_VERSION {
|
||||
p.send_axis_value120(axis, delta);
|
||||
} else if p.seat.version >= AXIS_DISCRETE_SINCE_VERSION {
|
||||
p.send_axis_discrete(axis, delta / AXIS_120);
|
||||
let mut accumulator = p.v120_accumulator[i].get();
|
||||
accumulator += delta;
|
||||
p.send_axis_discrete(axis, accumulator / AXIS_120);
|
||||
accumulator %= AXIS_120;
|
||||
p.v120_accumulator[i].set(accumulator);
|
||||
}
|
||||
}
|
||||
if let Some(delta) = event.px[i].get() {
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ pub struct WlPointer {
|
|||
pub seat: Rc<WlSeat>,
|
||||
pub tracker: Tracker<Self>,
|
||||
last_motion: Cell<(Fixed, Fixed)>,
|
||||
pub v120_accumulator: [Cell<i32>; 2],
|
||||
}
|
||||
|
||||
impl WlPointer {
|
||||
|
|
@ -83,6 +84,7 @@ impl WlPointer {
|
|||
seat: seat.clone(),
|
||||
tracker: Default::default(),
|
||||
last_motion: Default::default(),
|
||||
v120_accumulator: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue