rust-windowing / rust-windowing/winit
Sending MouseWheel event twice with Evdev
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
Hello.
Using Arch Linux on a Thinkpad x220, I switched from libinput to evdev for better trackpoint support.
After doing so, I noticed that scrolling in Alacritty was much faster.
Two times faster to be exact.
When looking at events, running alacritty --print-events, it can be seen that MouseWheel events are sent on both press and release of buttons 4 though 7

I think I was able to track the problem to this library.
Specifically to this point right here:
https://github.com/rust-windowing/winit/blob/e707052f66045a096a391e8d23cc41cba100db5f/src/platform_impl/linux/x11/event_processor.rs#L681-L702
I looked at the events when running with libinput, and it was reporting scrolling as axis motion.
Evdev does report scrolling as axis motion when using a regular mouse, but reports scrolling as button presses when using mouse wheel emulation for the trackpoint.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/platform_impl/linux/x11/event_processor.rs at lines 681-702 and reproduce the behavior using alacritty --print-events with evdev and libinput. Compare the button-press and button-release handling for mouse-wheel emulation; done means trackpoint scrolling no longer produces duplicate MouseWheel events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100