Skip to content

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

@Random-Scientist

Description

@Random-Scientist

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    S - docsAwareness, docs, examples, etc.S - platform parityUnintended platform differences

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions