On macOS sheets appear in the wrong location (fixes #21367)

This commit is contained in:
Benjamin Pasero committed 2017-02-26 07:57:42 +01:00
1 parent d41c48d46d
commit bd2ebc4f63
1 file changed
+11 -2
+11 -2
View File
@@ -205,18 +205,27 @@ export class VSCodeWindow implements IVSCodeWindow {
options.icon = path.join(this.environmentService.appRoot, 'resources/linux/code.png'); // Windows and Mac are better off using the embedded icon(s)
}
let useCustomTitleStyle = false;
if (platform.isMacintosh && (!this.options.titleBarStyle || this.options.titleBarStyle === 'custom')) {
const isDev = !this.environmentService.isBuilt || !!config.extensionDevelopmentPath;
if (!isDev) {
options.titleBarStyle = 'hidden'; // not enabled when developing due to https://github.com/electron/electron/issues/3647
this.hiddenTitleBarStyle = true;
useCustomTitleStyle = true; // not enabled when developing due to https://github.com/electron/electron/issues/3647
}
}
if (useCustomTitleStyle) {
options.titleBarStyle = 'hidden';
this.hiddenTitleBarStyle = true;
}
// Create the browser window.
this._win = new BrowserWindow(options);
this._id = this._win.id;
if (useCustomTitleStyle) {
this._win.setSheetOffset(22); // offset dialogs by the height of the custom title bar if we have any
}
if (isFullscreenOrMaximized) {
this.win.maximize();