rust-windowing / rust-windowing/winit

Sending MouseWheel event twice with Evdev

Open
#1,606 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C - needs investigation DS - x11 H - help wanted
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
2020-06-14-10h-27m-40s

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.