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:
12 files changed
+200
-44
No files matched your search
@@ -17,11 +17,18 @@ pub(all) struct Modifiers {
|
||||
depressed : UInt; latched : UInt; locked : UInt; group : UInt
|
||||
}
|
||||
///|
|
||||
/// Wheel/touchpad scroll: axis (0 vertical, 1 horizontal), distance in pixels (positive =
|
||||
/// down/right), wheel notches (0 when not from a wheel).
|
||||
pub(all) struct ScrollDelta {
|
||||
axis : UInt; value : Double; discrete : Int
|
||||
}
|
||||
///|
|
||||
pub(all) enum SeatEvent {
|
||||
PointerMove(PointerPos)
|
||||
PointerButton(KeyState)
|
||||
Key(KeyState)
|
||||
Modifiers(Modifiers)
|
||||
Scroll(ScrollDelta)
|
||||
}
|
||||
///|
|
||||
/// Take over the first connected output and the seat's input. None, with the reason on the
|
||||
@@ -98,7 +105,7 @@ pub fn take_input() -> Array[SeatEvent] {
|
||||
|
||||
let array : Array[SeatEvent] = [];
|
||||
for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 {
|
||||
let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 24)
|
||||
let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 32)
|
||||
|
||||
let lifted = match (mbt_ffi_load8_u((iter_base) + 0)) {
|
||||
0 => {
|
||||
@@ -117,6 +124,10 @@ pub fn take_input() -> Array[SeatEvent] {
|
||||
|
||||
SeatEvent::Modifiers(Modifiers::{depressed : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), latched : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint(), locked : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint(), group : (mbt_ffi_load32((iter_base) + 20)).reinterpret_as_uint()})
|
||||
}
|
||||
4 => {
|
||||
|
||||
SeatEvent::Scroll(ScrollDelta::{axis : (mbt_ffi_load32((iter_base) + 8)).reinterpret_as_uint(), value : mbt_ffi_loadf64((iter_base) + 16), discrete : mbt_ffi_load32((iter_base) + 24)})
|
||||
}
|
||||
_ => panic()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user