Skip to content

Discard mouse down after Cocoa window resize - #466

Merged
francesca64 merged 2 commits into
rust-windowing:masterfrom
swiftcoder:window_resize_mouse_up_fix
Apr 15, 2018
Merged

francesca64 merged 2 commits into
rust-windowing:masterfrom
swiftcoder:window_resize_mouse_up_fix

Conversation

@swiftcoder

Copy link
Copy Markdown
Contributor

We are sending the mouse down event after the window resize has
completed, because Cocoa uses a modal event loop to implement window
resize. This leads to a mouse down without a matching mouse up.

This fixes #463.

We are sending the mouse down event after the window resize has
completed, because Cocoa uses a modal event loop to implement window
resize. This leads to a mouse down without a matching mouse up.
@francesca64

Copy link
Copy Markdown
Member

Very nice. I've also confirmed that it fixes the referenced Alacritty problem.

It would be nice to have a comment or two added explaining what the discarding is for, though. In addition to that, a CHANGELOG entry can't hurt.

Add some explanatory comments and a changelog entry.
@francesca64

Copy link
Copy Markdown
Member

Thanks!

@francesca64
francesca64 merged commit 19cd531 into rust-windowing:master Apr 15, 2018
francesca64 added a commit that referenced this pull request Apr 18, 2018
francesca64 added a commit that referenced this pull request Apr 18, 2018
This reverts commit 19cd531.

Testing fullscreen functionality revealed that windowDidResize is invoked in more cases than previously thought, causing the user's events to be eaten and HiDPI problems.
tmfink pushed a commit to tmfink/winit that referenced this pull request Jan 5, 2022
Update canvas_nanovg example

The `canvas_nanovg` example would not run on my Linux machine due to the bug in `winit` 0.19 (rust-windowing#1773)

In this PR, I updated `winit` and `surfman` and made the minimum necessary changes so that the example would compile and run.
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.

macOS: winit emits a MouseInput event after resizing

2 participants