rust-windowing / rust-windowing/winit

Don't check for keyboard modifiers state on a flood of mouse events

Open
#4,239 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DS - win32 S - perf
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Description

(this is from a discussion from https://github.com/rust-windowing/winit/pull/4235)

Currently Winit performs checks for whether modifiers are changed on every single mouse event, which is rather inefficient as such input devices can generate a lot of events, so you'd be wasting a lot of API calls for key state.
And there are already some guards against missed keyboard/modifier changing events (e.g., if when the app regains focus, Winit checks modifier state), so the question is, could these mouse input checks be replaced by similar guards for the remaining cases where modifier change events are missed?

Unofrunately, I don't know what those are, so just leaving it as an open issue

Not sure about how other platforms do it, so marking this as Windows only

Relevant platforms

Windows

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 by tracing Winit's Windows handling of mouse events and the existing modifier-state guard used when the application regains focus. Identify the remaining cases where modifier changes can be missed, then verify that removing per-mouse-event checks preserves correct modifier state across those cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.