workaround for #75830

This commit is contained in:
Benjamin Pasero
2019-06-24 14:48:43 +02:00
parent 3e52e92085
commit 8e79172726

View File

@@ -156,7 +156,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
}
}
if (isMacintosh && windowConfig && windowConfig.nativeTabs === true) {
const useNativeTabs = isMacintosh && windowConfig && windowConfig.nativeTabs === true;
if (useNativeTabs) {
options.tabbingIdentifier = product.nameShort; // this opts in to sierra tabs
}
@@ -180,7 +181,10 @@ export class CodeWindow extends Disposable implements ICodeWindow {
// TODO@Ben (Electron 4 regression): when running on multiple displays where the target display
// to open the window has a larger resolution than the primary display, the window will not size
// correctly unless we set the bounds again (https://github.com/microsoft/vscode/issues/74872)
if (isMacintosh && hasMultipleDisplays) {
// However, when running with native tabs we cannot use this workaround because there is a potential
// that the new window will be added as native tab instead of being a window on its own. In that
// case calling setBounds() would cause https://github.com/microsoft/vscode/issues/75830
if (isMacintosh && hasMultipleDisplays && !useNativeTabs) {
if ([this.windowState.width, this.windowState.height, this.windowState.x, this.windowState.y].every(value => typeof value === 'number')) {
this._win.setBounds({
width: this.windowState.width!,