From 2e1d07abc20e603df425c8edc623d5c01ac3756c Mon Sep 17 00:00:00 2001 From: Orion Date: Sun, 18 Jan 2026 03:00:31 +0100 Subject: [PATCH] fix 2D scroll in apps spawned inside wayvr (#401) --- wayvr/src/backend/wayvr/window.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/wayvr/src/backend/wayvr/window.rs b/wayvr/src/backend/wayvr/window.rs index 753e20f1..de454370 100644 --- a/wayvr/src/backend/wayvr/window.rs +++ b/wayvr/src/backend/wayvr/window.rs @@ -1,5 +1,6 @@ use std::rc::Rc; +use smithay::backend::input::{AxisRelativeDirection, AxisSource}; use smithay::{ input, utils::{Logical, Point}, @@ -111,16 +112,32 @@ impl Window { } 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: None, + source: Some(AxisSource::Continuous), relative_direction: ( - smithay::backend::input::AxisRelativeDirection::Identical, - smithay::backend::input::AxisRelativeDirection::Identical, + AxisRelativeDirection::Identical, + AxisRelativeDirection::Identical, ), time: 0, - axis: (f64::from(delta.x), f64::from(-delta.y)), + 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), },