Skip to content

Several fixes for the macOS backend#157

Merged
mitchmindtree merged 5 commits into
rust-windowing:masterfrom
mitchmindtree:macos_fixes
Mar 22, 2017
Merged

Several fixes for the macOS backend#157
mitchmindtree merged 5 commits into
rust-windowing:masterfrom
mitchmindtree:macos_fixes

Conversation

@mitchmindtree
Copy link
Copy Markdown
Contributor

@mitchmindtree mitchmindtree commented Mar 19, 2017

While updating glutin and glium and 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.

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.
@mitchmindtree
Copy link
Copy Markdown
Contributor Author

@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 :)

@MichaelShaw
Copy link
Copy Markdown

All examples run fine on Sierra, no regressions relative to master.

@mitchmindtree
Copy link
Copy Markdown
Contributor Author

@MichaelShaw thanks!

@mitchmindtree mitchmindtree merged commit ef57b4b into rust-windowing:master Mar 22, 2017
@mitchmindtree
Copy link
Copy Markdown
Contributor Author

@tomaka Could you publish a new tiny version for this? That way I can update rust-windowing/glutin#864 before it gets merged.

@tomaka
Copy link
Copy Markdown
Contributor

tomaka commented Mar 22, 2017

@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.

@MichaelShaw
Copy link
Copy Markdown

I'm attempting to test the changes, I can confirm

  • cccc48b "[macos] Emit a resize event when Window changes screens" works on Sierra.

  • 4656540 "Close NSWindow when Window is dropped if not already closed. " isn't working though, msg_send![nswindow, close]; is getting called but the window isn't closing.

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.

@mitchmindtree
Copy link
Copy Markdown
Contributor Author

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.

@MichaelShaw
Copy link
Copy Markdown

Yep, I get the identical behaviour in past releases, so there's no regressions. I'll search around for NSWindow changes etc.

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.

Replacing an old window with a new window does not close/destroy the old window on Mac

3 participants