Skip to content

Fix stale pointer hover during macOS live resize - #4681

Open
yay wants to merge 1 commit into
rust-windowing:masterfrom
yay:steady/macos-live-resize-hover
Open

Fix stale pointer hover during macOS live resize#4681
yay wants to merge 1 commit into
rust-windowing:masterfrom
yay:steady/macos-live-resize-hover

Conversation

@yay

@yay yay commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Bug:

2026-09-05 16 34 53

During native macOS window resizing, AppKit can take ownership of the mouse without delivering mouseExited: or further mouseMoved: events to the content view. Applications that retain the last pointer position continue hit-testing it during resize redraws.

In an egui application with a responsive tab bar in the above GIF, expanding the right edge consequently highlights earlier tabs and opens their tooltips while the real pointer remains at the window edge.

Attached is a pure winit/AppKit demo that also reproduces the bug in the latest winit master: winit-hover-resize.zip

Fix:

Emit PointerLeft when live resizing starts and suppress incidental pointer entry/motion until it ends. At the end, sample mouseLocationOutsideOfEventStream, convert into view/backing coordinates, and emit PointerEntered followed by PointerMoved if the pointer is inside the current view bounds.

Request redraws at both transitions so hover state can update without another mouse movement.

@yay
yay requested a review from madsmtm as a code owner September 5, 2026 14:52
@yay
yay marked this pull request as draft September 5, 2026 15:06
@yay
yay marked this pull request as ready for review September 5, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant