diff --git a/CHANGELOG.md b/CHANGELOG.md index 289c921d..1d447ae1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Unreleased` header. # Unreleased +- On Wayland, fix DeviceEvent::Motion not being sent - On X11, don't require XIM to run. - On X11, fix xkb state not being updated correctly sometimes leading to wrong input. - Fix compatibility with 32-bit platforms without 64-bit atomics. diff --git a/src/platform_impl/linux/wayland/seat/pointer/relative_pointer.rs b/src/platform_impl/linux/wayland/seat/pointer/relative_pointer.rs index 23a6e219..f7364e37 100644 --- a/src/platform_impl/linux/wayland/seat/pointer/relative_pointer.rs +++ b/src/platform_impl/linux/wayland/seat/pointer/relative_pointer.rs @@ -60,19 +60,34 @@ impl Dispatch for RelativePointerS _conn: &Connection, _qhandle: &QueueHandle, ) { - if let zwp_relative_pointer_v1::Event::RelativeMotion { - dx_unaccel, - dy_unaccel, - .. - } = event - { - state.events_sink.push_device_event( - DeviceEvent::MouseMotion { - delta: (dx_unaccel, dy_unaccel), - }, - super::DeviceId, - ); - } + let (dx_unaccel, dy_unaccel) = match event { + zwp_relative_pointer_v1::Event::RelativeMotion { + dx_unaccel, + dy_unaccel, + .. + } => (dx_unaccel, dy_unaccel), + _ => return, + }; + state.events_sink.push_device_event( + DeviceEvent::Motion { + axis: 0, + value: dx_unaccel, + }, + super::DeviceId, + ); + state.events_sink.push_device_event( + DeviceEvent::Motion { + axis: 1, + value: dy_unaccel, + }, + super::DeviceId, + ); + state.events_sink.push_device_event( + DeviceEvent::MouseMotion { + delta: (dx_unaccel, dy_unaccel), + }, + super::DeviceId, + ); } }