diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 8d55160477b..b346f149aab 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -179,7 +179,7 @@ export class VSCodeWindow { options.icon = path.join(this.environmentService.appRoot, 'resources/linux/code.png'); // Windows and Mac are better off using the embedded icon(s) } - if (this.options.titleBarStyle === 'custom' && platform.isMacintosh) { + if (platform.isMacintosh && (!this.options.titleBarStyle || this.options.titleBarStyle === 'custom')) { const isDev = !this.environmentService.isBuilt || this.environmentService.extensionDevelopmentPath; if (!isDev) { options.titleBarStyle = 'hidden'; // not enabled when developing due to https://github.com/electron/electron/issues/3647 diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index efd863359e3..822639e4738 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -29,7 +29,7 @@ const HIDE_SIDEBAR_WIDTH_THRESHOLD = 50; const HIDE_PANEL_HEIGHT_THRESHOLD = 50; interface ComputedStyles { - titlebar: { height: number; }; + titlebar: { height: number; display: string; }; activitybar: { width: number; }; sidebar: { minWidth: number; }; panel: { minHeight: number; }; @@ -295,7 +295,8 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal // Determine styles by looking into their CSS this.computedStyles = { titlebar: { - height: parseInt(titlebarStyle.getPropertyValue('height'), 10) + height: parseInt(titlebarStyle.getPropertyValue('height'), 10), + display: titlebarStyle.getPropertyValue('display') }, activitybar: { width: parseInt(activitybarStyle.getPropertyValue('width'), 10) @@ -352,7 +353,12 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal } this.statusbarHeight = isStatusbarHidden ? 0 : this.computedStyles.statusbar.height; - this.titlebarHeight = this.initialComputedStyles.titlebar.height / getZoomFactor(); // adjust for zoom prevention + + if (this.computedStyles.titlebar.display === 'none') { + this.titlebarHeight = 0; // custom title bar is hidden + } else { + this.titlebarHeight = this.initialComputedStyles.titlebar.height / getZoomFactor(); // adjust for zoom prevention + } this.sidebarHeight = this.workbenchSize.height - this.statusbarHeight - this.titlebarHeight; let sidebarSize = new Dimension(sidebarWidth, this.sidebarHeight); diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 9bca7424a20..d66beeb7202 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -159,7 +159,7 @@ if (platform.isMacintosh) { properties['window.titleBarStyle'] = { 'type': 'string', 'enum': ['native', 'custom'], - 'default': 'native', + 'default': 'custom', 'description': nls.localize('titleBarStyle', "Adjust the appearance of the window title bar. Changes require a full restart to apply.") }; }