Mouse wheel scrolls windows: forward scroll to Wayland clients

The wheel used to reach only the Interface Explorer dialog; clients never got
wl_pointer.axis, and the login-session (KMS/libinput) backend dropped scroll events.

- libinput axis events (wheel, touchpad, trackpoint) are queued as EV_AXIS and
  surface as InputEvent::Scroll(axis, value, discrete) in both the native and
  wasm (moonplasma:host/display seat-event.scroll) backends.
- The nested backend keeps horizontal scroll and the host's axis_discrete notches.
- The compositor sends axis_source(wheel) + axis_discrete/axis_value120 + axis +
  frame to the popup or window under the pointer; the explorer still takes the
  wheel while inspect mode is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjdz1uQ1y3GgazdKrR
This commit is contained in:
Claude authored and V committed 2026-11-25 17:07:33 +00:00
1 parent 63e63c65e0
commit d0d375c071
12 files changed
+200 -44

No files matched your search

+39
View File
@@ -1300,6 +1300,45 @@ pub fn WaylandServer::pointer_button(self : WaylandServer, win_id : UInt64, time
}
}
///| Scroll: `axis` 0 vertical / 1 horizontal, `value` in surface pixels (positive = down/right),
/// `discrete` wheel notches (0 for continuous sources such as touchpads).
pub fn WaylandServer::pointer_axis(
self : WaylandServer,
win_id : UInt64,
time_ms : UInt,
axis : UInt,
value : Double,
discrete : Int,
) -> Unit {
match self.win_client(win_id) {
None => ()
Some((c, _)) =>
for pid in c.pointer_ids {
if c.seat_ver >= 5U && discrete != 0 {
// axis_source(wheel), then the notch count, both before the axis event.
let ws = WireWriter::new()
ws.u32(0U)
c.send_msg(ws.finish_msg(pid, 6U))
let wd = WireWriter::new()
wd.u32(axis)
if c.seat_ver >= 8U {
wd.i32(discrete * 120)
c.send_msg(wd.finish_msg(pid, 9U)) // axis_value120
} else {
wd.i32(discrete)
c.send_msg(wd.finish_msg(pid, 8U)) // axis_discrete
}
}
let w = WireWriter::new()
w.u32(time_ms)
w.u32(axis)
w.i32(fixed(value))
c.send_msg(w.finish_msg(pid, 4U))
self.pointer_frame(c, pid)
}
}
}
///|
fn WaylandServer::pointer_frame(_self : WaylandServer, c : ClientConn, pid : UInt) -> Unit {
if c.seat_ver >= 5U {