Merged
Conversation
rebornix
commented
Jun 20, 2019
| if (!(<any>document).webkitIsFullScreen) { | ||
| (<any>target).webkitRequestFullscreen(); // it's async, but doesn't return a real promise. | ||
| browser.setFullscreen(true); | ||
| browser.setFullscreen(true); // we have to set this proactively because Safari doesn't emit fullscreenchange event. |
Member
Author
There was a problem hiding this comment.
As I commented, we can't fully rely on fullscreenchange as Safari doesn't implement it, even though it's Living Standard.
sbatten
approved these changes
Jun 20, 2019
Member
sbatten
left a comment
There was a problem hiding this comment.
discussed with @rebornix. We think the listener should try to be in a service like window service since it already couples this behavior. Otherwise, the listener is floating in a file and easily forgotten. However, at some point we should really tackle the enormous windowservice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS, we can override browsers'
ctrl+cmd+fto do our own Toggle Full Screen so our current code works as expected byctrl+cmd+fWindowService.toggleFullScreenBrowser.setFullScreen()However, on Windows, you can use F11 to Toggle Full Screen with the same experience, but it's a browser feature and we can't override. It means the workspace turns into fullscreen, however as we didn't receive any event, we miss one step
Browser.setFullScreen()Without above step, the workbench is not aware of the window state. This PR introduces an event listener for
fullscreenchange. In Chromium on all platforms, the workflow becomesCmd+Ctrl+ForF11requestFullScreenfullscreenchangeBrowser.setFullScreen()