rust-windowing / rust-windowing/winit

set_cursor_position affects mouse event deltas [macos]

Open
#999 4 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug C - needs investigation DS - appkit H - good first issue H - help wanted
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Calling set_cursor_position does not generate a DeviceEvent::MouseMotion event, but the change in position is added to the delta of the next MouseMotion event.

This is inconvenient to deal with in a client app, since I don't see a (straightforward) way to retrieve the cursor position (i.e. there isn't a simple get_cursor_position), and hence it's complicated to figure out the delta that needs to be subtracted from the next MouseMotion event.

Behaviour only noted on a Mac. Does not repro on 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

No files or tests are identified in the issue. Start by reproducing the behavior on macOS and trace set_cursor_position together with the next DeviceEvent::MouseMotion; done means programmatic cursor movement no longer alters that event's reported delta.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.