Skip to content

Commit 39b79d8

Browse files
authored
slow scrolling chrome with emulation=wlroots capture=layer-shell (#318) (#325)
Using niri as compositor on both sides resulting in: emulation=wlroots capture=layer-shell Mouse scrolling works fine in terminals, but only scrolls very small amount in google-chrome (in wayland mode) Using 'wev' to show events, using the real mouse shows [ 15: wl_pointer] axis_source: 0 (wheel) [ 15: wl_pointer] axis_value120: axis: 0 (vertical), value120: 120 [ 15: wl_pointer] axis_relative_direction: axis: 0 (vertical), direction: 0 [ 15: wl_pointer] axis: time: 50410752; axis: 0 (vertical), value: 15.000000 Using the lan-mouse shows: [ 15: wl_pointer] axis_source: 2 (continuous) [ 15: wl_pointer] axis_value120: axis: 0 (vertical), value120: 1 [ 15: wl_pointer] axis_relative_direction: axis: 0 (vertical), direction: 0 [ 15: wl_pointer] axis: time: -1913142096; axis: 0 (vertical), value: 20.000000 Without axis_source, scrolling over (pinned) tabs also skips one tab.
1 parent 5ad90ca commit 39b79d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

input-emulation/src/wlroots.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use wayland_client::backend::WaylandError;
1212
use wayland_client::WEnum;
1313

1414
use wayland_client::protocol::wl_keyboard::{self, WlKeyboard};
15-
use wayland_client::protocol::wl_pointer::{Axis, ButtonState};
15+
use wayland_client::protocol::wl_pointer::{Axis, AxisSource, ButtonState};
1616
use wayland_client::protocol::wl_seat::WlSeat;
1717
use wayland_protocols_wlr::virtual_pointer::v1::client::{
1818
zwlr_virtual_pointer_manager_v1::ZwlrVirtualPointerManagerV1 as VpManager,
@@ -210,7 +210,8 @@ impl VirtualInput {
210210
PointerEvent::AxisDiscrete120 { axis, value } => {
211211
let axis: Axis = (axis as u32).try_into()?;
212212
self.pointer
213-
.axis_discrete(now, axis, value as f64 / 6., value / 120);
213+
.axis_discrete(now, axis, value as f64 / 8., value);
214+
self.pointer.axis_source(AxisSource::Wheel);
214215
self.pointer.frame();
215216
}
216217
}

0 commit comments

Comments
 (0)