mirror of https://github.com/wayvr-org/wayvr.git
wvr_server: tweak wheel values & cleanup
This commit is contained in:
parent
e38dec41be
commit
82af4671f0
|
|
@ -323,9 +323,9 @@ impl WayVRCompositor {
|
|||
pub fn send_pointer_axis_wheel(&mut self, delta: super::WheelDelta) {
|
||||
let time = super::time::get_millis() as u32;
|
||||
|
||||
let multiplier = 64.0; // stolen from uniput.rs
|
||||
let multiplier = 32.0;
|
||||
let delta_x = (delta.x * multiplier) as i32;
|
||||
let delta_y = (delta.y * multiplier) as i32;
|
||||
let delta_y = (-delta.y * multiplier) as i32;
|
||||
|
||||
if delta_x == 0 && delta_y == 0 {
|
||||
return;
|
||||
|
|
@ -335,14 +335,14 @@ impl WayVRCompositor {
|
|||
|
||||
if delta_x != 0 {
|
||||
frame = frame
|
||||
.value(Axis::Horizontal, delta_x as f64 * 15.0)
|
||||
.v120(Axis::Horizontal, delta_x * 120);
|
||||
.value(Axis::Horizontal, delta_x as f64)
|
||||
.v120(Axis::Horizontal, delta_x);
|
||||
}
|
||||
|
||||
if delta_y != 0 {
|
||||
frame = frame
|
||||
.value(Axis::Vertical, delta_y as f64 * 15.0)
|
||||
.v120(Axis::Vertical, delta_y * 120);
|
||||
.value(Axis::Vertical, delta_y as f64)
|
||||
.v120(Axis::Vertical, delta_y);
|
||||
}
|
||||
|
||||
self.seat_pointer.axis(&mut self.state, frame);
|
||||
|
|
|
|||
|
|
@ -110,40 +110,6 @@ impl Window {
|
|||
|
||||
manager.seat_pointer.frame(&mut manager.state);
|
||||
}
|
||||
|
||||
pub(super) fn send_mouse_scroll(manager: &mut WayVRCompositor, delta: WheelDelta) {
|
||||
// workaround: it seems that with one event most applications work fine, but cage doesn't
|
||||
manager.seat_pointer.axis(
|
||||
&mut manager.state,
|
||||
input::pointer::AxisFrame {
|
||||
source: Some(AxisSource::Continuous),
|
||||
relative_direction: (
|
||||
AxisRelativeDirection::Identical,
|
||||
AxisRelativeDirection::Identical,
|
||||
),
|
||||
time: 0,
|
||||
axis: (f64::from(delta.x), 0.0),
|
||||
v120: Some(((delta.x * 64.0) as i32, 0)),
|
||||
stop: (false, false),
|
||||
},
|
||||
);
|
||||
|
||||
manager.seat_pointer.axis(
|
||||
&mut manager.state,
|
||||
input::pointer::AxisFrame {
|
||||
source: Some(AxisSource::Continuous),
|
||||
relative_direction: (
|
||||
AxisRelativeDirection::Identical,
|
||||
AxisRelativeDirection::Identical,
|
||||
),
|
||||
time: 0,
|
||||
axis: (0.0, f64::from(-delta.y)),
|
||||
v120: Some((0, (delta.y * -64.0) as i32)),
|
||||
stop: (false, false),
|
||||
},
|
||||
);
|
||||
manager.seat_pointer.frame(&mut manager.state);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ struct RenderedSurface {
|
|||
image: Arc<ImageView>,
|
||||
pos: Vec2,
|
||||
size: Vec2,
|
||||
dmabuf: bool,
|
||||
}
|
||||
|
||||
enum WvrHitTarget {
|
||||
|
|
@ -500,7 +499,6 @@ impl OverlayBackend for WvrWindowBackend {
|
|||
image,
|
||||
pos: vec2(point.x as _, point.y as _),
|
||||
size: vec2(size[0], size[1]),
|
||||
dmabuf: false,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
|
@ -1004,7 +1002,6 @@ fn collect_rendered_surface_tree(root: &WlSurface) -> Vec<RenderedSurface> {
|
|||
image: surf.image,
|
||||
pos: vec2(pos.x as f32, pos.y as f32),
|
||||
size: vec2(extent[0] / scale, extent[1] / scale),
|
||||
dmabuf: surf.dmabuf,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue