Skip to content
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

Add window.nonNativeFullscreen option for macOS #55267

Merged
merged 14 commits into from Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/vs/code/electron-main/window.ts
Expand Up @@ -824,11 +824,19 @@ export class CodeWindow implements ICodeWindow {
return { x: pos[0], y: pos[1], width: dimension[0], height: dimension[1] };
}


toggleFullScreen(): void {
const willBeFullScreen = !this._win.isFullScreen();
const windowConfig = this.configurationService.getValue<IWindowSettings>('window');

// set fullscreen flag on window
this._win.setFullScreen(willBeFullScreen);
if (windowConfig && windowConfig.nonNativeFullscreen) {
const willBeFullScreen = !this._win.isSimpleFullScreen();
this._win.setFullScreen(false);
this._win.setSimpleFullScreen(willBeFullScreen);
} else {
const willBeFullScreen = !this._win.isFullScreen();
this._win.setSimpleFullScreen(false);
this._win.setFullScreen(willBeFullScreen);
}

// respect configured menu bar visibility or default to toggle if not set
this.setMenuBarVisibility(this.currentMenuBarVisibility, false);
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/windows/common/windows.ts
Expand Up @@ -242,6 +242,7 @@ export interface IWindowSettings {
menuBarVisibility: MenuBarVisibility;
newWindowDimensions: 'default' | 'inherit' | 'maximized' | 'fullscreen';
nativeTabs: boolean;
nonNativeFullscreen: boolean;
enableMenuBarMnemonics: boolean;
closeWhenEmpty: boolean;
smoothScrollingWorkaround: boolean;
Expand Down
6 changes: 6 additions & 0 deletions src/vs/workbench/electron-browser/main.contribution.ts
Expand Up @@ -644,6 +644,12 @@ configurationRegistry.registerConfiguration({
'description': nls.localize('window.nativeTabs', "Enables macOS Sierra window tabs. Note that changes require a full restart to apply and that native tabs will disable a custom title bar style if configured."),
'included': isMacintosh && parseFloat(os.release()) >= 16 // Minimum: macOS Sierra (10.12.x = darwin 16.x)
},
'window.nonNativeFullscreen': {
'type': 'boolean',
'default': false,
'description': nls.localize('window.nonNativeFullscreen', "Uses non-native (or simple) fullscreen as to not create a new space when fullscreen is toggled."),
'included': isMacintosh
},
'window.smoothScrollingWorkaround': {
'type': 'boolean',
'default': false,
Expand Down