Document or unify some edge case behaviors between platforms with mouse pointers

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust

Research direction

Start with cargo run --example window on the available platforms and repeat the three pointer experiments described in the issue, recording the events shown in the log. Fill the TODO cells with observed results, then determine from the project discussion whether the completed work should document the differences or unify the behavior; the table and its footnotes should clearly reflect the result.

Written by the indexing model from the issue text.

Description

S - docs S - platform parity
Description

While testing for #4514 we discovered that every platform we tested behaves a bit differently in some cases.

Moved = PointerMoved, Presence = PointerEntered + PointerLeft, Drag = DragMoved + DragEntered + DragLeft, None = nothing.

Cells marked TODO still need testing. To test, cargo run --example window on your platform of choice, perform the experiment and note which winit events you see in the log.

Test Case Windows Linux (X11) Linux(Wayland) macOS
Mouseover with LMB held but empty cursor1 None Presence (GNOME) None (GNOME) None
Mouseover while holding draggable2 Drag (TODO check for Presence/Moved) TODO TODO Moved, Presence, Drag
Mouseover while unfocused3 Moved, Presence Moved, Presence (GNOME) Moved, Presence (GNOME) Moved, Presence4
1.
  • Press LMB on desktop/background (not a draggable). (should unfocus the window if it is focused)
  • move pointer over window.
  • move pointer off of window.
  • release LMB.
2.
  • Press LMB over a file while focused on the winit window, picking it up for dragging.
  • move pointer over window.
  • move pointer off of window.
  • release LMB.
3.
  • unfocus window, pointer off of window.
  • move pointer over window.
  • move pointer off window.
4.

on winit master with older macOS versions, only Presence is emitted here (due to AppKit treatment of trackingRect), but receiving movement as well is more consistent with other platforms, and #4514 changes the implementation to respect this behavior across all macOS versions.

Relevant platforms

No response

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

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.

More from rust-windowing/winit

All issues in rust-windowing/winit

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.