ITADN

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

#4527OpenRandom-Scientist 创建于 2026-03-17
S - enhancement
### 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 cursor<sup>1</sup> | `None` | `Presence` (GNOME) | `None` (GNOME)| `None` | | Mouseover while holding draggable<sup>2</sup> | `Drag` (TODO check for `Presence`/`Moved`) | TODO | TODO | `Moved`, `Presence`, `Drag`| | Mouseover while unfocused<sup>3</sup> | `Moved`, `Presence` | `Moved`, `Presence` (GNOME) | `Moved`, `Presence` (GNOME) | `Moved`, `Presence`<sup>4</sup> | #### 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_
0 条评论