rust-windowing / rust-windowing/winit

`CursorEntered` and `CursorLeft` events not getting sent if entered a second window while holding the mouse button down

Open
#3,908 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

CursorEntered and CursorLeft works perfectly only for the window you start the drag and drop gesture. While holding the mouse button the events are not fired in another window.

How to reproduce:

  • create 2 windows (e.g. press ctrl+N in the window example)
  • make a drag and drop gesture from one window into another (press and hold a mouse button, in first window and release it in the second window)

Expected Result:

  • CursorEntered event is fired as soon as the second window is entered.

Actual Result:

  • CursorEntered event is fired after the mouse button is released. And a second CursorLeft event is fired for the first window.

I've tested it only on windows. I'm not sure if it is related to windows or the following fixed bug Issue #3153

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

Reproduce the drag-and-drop case using the window example with two windows on Windows. Start by tracing the Windows event handling for CursorEntered and CursorLeft, then verify that entering the second window while holding the mouse button emits CursorEntered immediately and does not emit a delayed or duplicate CursorLeft.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.