Several fixes for the macOS backend#157
Conversation
This can happen when window is destroyed/created during a call to user callback as this causes WindowDelegate method to be called. Instead if the user callback is `None` store the event in `pending_events`.
Previously, a Window was only removed from the list when dropped.
Previously, if a `Window` was `Drop`ped while open, the window would remain open until the user pressed the x button. This fixes the behaviour so that the window is closed when dropped if it has not already been closed.
|
@MichaelShaw sorry to bother, are you able to test that this doesn't cause any regressions in the examples on Sierra? My machine is still running Yosemite for now. They should be fine, but it would be nice to get a second check :) |
|
All examples run fine on Sierra, no regressions relative to master. |
|
@MichaelShaw thanks! |
|
@tomaka Could you publish a new tiny version for this? That way I can update rust-windowing/glutin#864 before it gets merged. |
|
@mitchmindtree I setup the repo to automatically publish the master branch on crates.io, so any PR that modifies the version will get published once merged. |
|
I'm attempting to test the changes, I can confirm
Running https://gist.github.com/MichaelShaw/4bd30d95a9512fb1b5f4507ea0698441 on windows 10 the window closes immediately, on Sierra the window is only closed when the process is killed. |
I'm having trouble reproducing this on Yosemite - for me the window closes immediately and I've not yet been able to find any documentation explaining why this wouldn't work, but I'll keep searching. I don't think it's too big of a deal though, as the behaviour you are getting on Sierra was the behaviour prior to this PR for all versions of macOS. It would be nice to find a fix though. |
|
Yep, I get the identical behaviour in past releases, so there's no regressions. I'll search around for NSWindow changes etc. |
While updating
glutinandgliumand testing their examples, several bugs in the macOS backend started to show themselves. See the individual commits and their messages for details on each of the fixes.Closes #73.