-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle async nature of [NSWindow -toggleFullScreen] #25470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the docs don't mention anything about not calling this twice.
01ebb6d
to
3ddd100
Compare
3474b8a
to
b617395
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could write some tests for this!
e.g.:
requestFullScreen
immediately followed by cancelFullScreen
should produce the appropriate events and the window should ultimately end up not in fullscreen mode. request
-> cancel
-> request
should end up in fullscreen mode and likewise generate the relevant events.
b617395
to
199f3b6
Compare
b8da7f3
to
e1111e9
Compare
Holding this for a bit to explore a few edge cases |
e1111e9
to
ba71ff3
Compare
I was unable to backport this PR to "10-x-y" cleanly; |
@codebytere has manually backported this PR to "13-x-y", please check out #28763 |
@codebytere has manually backported this PR to "12-x-y", please check out #28772 |
@codebytere has manually backported this PR to "11-x-y", please check out #28773 |
Description of Change
Closes #25426.
Closes #25427.
[NSWindow -toggleFullScreen]
is an asynchronous operation, which means that it's possible to call it while a fullscreen transition is currently in process. As such, this can create weird behavior (incl. phantom windows and missing traffic lights) and so we want to queue up transitions until the previous ones have completed. We do this by tracking when fullscreen transitions begin and end, and scheduling those transitions to execute in order after any current transitions complete.cc @MarshallOfSound @nornagon @zcbenz
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where multiple calls to
window.setFullScreen
could cause problems.