Update to electron 1.6.x (#23842)

This commit is contained in:
Benjamin Pasero
2017-04-10 07:58:06 +02:00
committed by GitHub
parent 825c7b23e6
commit ebf71dae52
13 changed files with 105 additions and 61 deletions

View File

@@ -35,7 +35,6 @@ export interface IWindowCreationOptions {
state: IWindowState;
extensionDevelopmentPath?: string;
isExtensionTestHost?: boolean;
titleBarStyle?: 'native' | 'custom';
}
export enum WindowMode {
@@ -190,7 +189,8 @@ export class VSCodeWindow {
show: !isFullscreenOrMaximized,
title: product.nameLong,
webPreferences: {
'backgroundThrottling': false // by default if Code is in the background, intervals and timeouts get throttled
'backgroundThrottling': false, // by default if Code is in the background, intervals and timeouts get throttled,
disableBlinkFeatures: 'Auxclick' // disable auxclick events (see https://developers.google.com/web/updates/2016/10/auxclick)
}
};
@@ -198,14 +198,26 @@ 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)
}
const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window');
let useNativeTabs = false;
if (windowConfig && windowConfig.nativeTabs) {
options.tabbingIdentifier = product.nameShort; // this opts in to sierra tabs
useNativeTabs = true;
}
let useCustomTitleStyle = false;
if (platform.isMacintosh && (!this.options.titleBarStyle || this.options.titleBarStyle === 'custom')) {
if (platform.isMacintosh && (!windowConfig || !windowConfig.titleBarStyle || windowConfig.titleBarStyle === 'custom')) {
const isDev = !this.environmentService.isBuilt || !!config.extensionDevelopmentPath;
if (!isDev) {
useCustomTitleStyle = true; // not enabled when developing due to https://github.com/electron/electron/issues/3647
}
}
if (useNativeTabs) {
useCustomTitleStyle = false; // native tabs on sierra do not work with custom title style
}
if (useCustomTitleStyle) {
options.titleBarStyle = 'hidden';
this.hiddenTitleBarStyle = true;

View File

@@ -851,8 +851,7 @@ export class WindowsManager implements IWindowsMainService {
vscodeWindow = new VSCodeWindow({
state,
extensionDevelopmentPath: configuration.extensionDevelopmentPath,
isExtensionTestHost: !!configuration.extensionTestsPath,
titleBarStyle: windowConfig ? windowConfig.titleBarStyle : void 0
isExtensionTestHost: !!configuration.extensionTestsPath
},
this.logService,
this.environmentService,