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

+12
View File
@@ -115,6 +115,18 @@ test "host input reaches the focused client and the launcher popup opens" {
assert_true(has_msg(msgs, ptr_id, 3U)) // button
assert_true(has_msg(msgs, kbd_id, 3U)) // wl_keyboard.key
// The mouse wheel over the window scrolls it: axis_source + axis_discrete + axis.
comp.handle_input(@nested.InputEvent::Scroll(0U, 15.0, 1), 14U)
let wheel = drain_msgs(c)
assert_true(has_msg(wheel, ptr_id, 6U)) // wl_pointer.axis_source
assert_true(has_msg(wheel, ptr_id, 8U)) // wl_pointer.axis_discrete
assert_true(has_msg(wheel, ptr_id, 4U)) // wl_pointer.axis
// A touchpad (no notches) sends only the continuous axis.
comp.handle_input(@nested.InputEvent::Scroll(1U, -3.5, 0), 15U)
let pad = drain_msgs(c)
assert_true(has_msg(pad, ptr_id, 4U))
assert_false(has_msg(pad, ptr_id, 8U))
// Cursor: a client that asks for a text cursor gets it inside its window...
let shape_mgr = bind_global(c, reg_id, "wp_cursor_shape_manager_v1", 1U)
let shape_dev = c.alloc_id()