Skip to content

fix(wayland): prevent libinput unset axis error on scroll#194

Open
uint82 wants to merge 2 commits into
Narsil:mainfrom
uint82:main
Open

fix(wayland): prevent libinput unset axis error on scroll#194
uint82 wants to merge 2 commits into
Narsil:mainfrom
uint82:main

Conversation

@uint82

@uint82 uint82 commented Jul 8, 2026

Copy link
Copy Markdown

Description

This PR fixes an issue where scrolling a mouse wheel under Wayland causes libinput to aggressively spam the console with the following error:
libinput error: client bug: value requested for unset axis

The Cause:
Currently, when a PointerScrollWheelEvent is received, the code unconditionally requests both Axis::Horizontal and Axis::Vertical values. If the physical mouse only triggered a vertical scroll, requesting the horizontal axis triggers a safety check inside libinput, resulting in the "client bug" error.

The Fix:
I imported the PointerScrollEvent trait and wrapped the axis value requests in an if btn.has_axis(...) check. If the axis wasn't triggered by the hardware, it safely defaults to 0 instead of querying libinput.

Changes Made

  • Added use input::event::pointer::PointerScrollEvent; to imports.
  • Updated the PointerEvent::ScrollWheel(btn) match arm to verify axis existence before calculating delta_x and delta_y.

Additional Context

I ran into this while building a macro recorder for Wayland. My engine bypasses user-space jitter by using evdev directly for recording, but I am still using rdev to listen for global hotkeys (like F-keys) to start/stop the macros.

Whenever I scrolled my mouse wheel, this Wayland axis bug would trigger and spam my macro engine's terminal output. This fix keeps the console completely clean!

uint82 added 2 commits July 8, 2026 19:59
Refactor scroll wheel event handling to check for axis presence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant