Merge remote-tracking branch 'upstream/master' into feature/allow_auto_hide_menu_bar_configuration

This commit is contained in:
David Terry committed 2017-01-06 23:31:12 +01:00
commit 63aefa5481
100 files changed
+1456 -1976

No files matched your search

+2 -2
View File
@@ -93,7 +93,7 @@ export class LaunchService implements ILaunchService {
let usedWindows: VSCodeWindow[];
if (!!args.extensionDevelopmentPath) {
this.windowsService.openExtensionDevelopmentHostWindow({ context, cli: args, userEnv });
} else if (args._.length === 0 && args['new-window']) {
} else if (args._.length === 0 && args['new-window'] || args['new-window-if-not-first']) {
usedWindows = this.windowsService.open({ context, cli: args, userEnv, forceNewWindow: true, forceEmpty: true });
} else if (args._.length === 0) {
usedWindows = [this.windowsService.focusLastActive(args, context)];
@@ -102,7 +102,7 @@ export class LaunchService implements ILaunchService {
context,
cli: args,
userEnv,
forceNewWindow: args.wait || args['new-window'],
forceNewWindow: args.wait || args['new-window'] || args['new-window-if-not-first'],
preferNewWindow: !args['reuse-window'],
forceReuseWindow: args['reuse-window'],
diffMode: args.diff
+1 -1
View File
@@ -257,7 +257,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
} else if (global.macOpenFiles && global.macOpenFiles.length && (!environmentService.args._ || !environmentService.args._.length)) {
windowsMainService.open({ context: OpenContext.DOCK, cli: environmentService.args, pathsToOpen: global.macOpenFiles, initialStartup: true }); // mac: open-file event received on startup
} else {
windowsMainService.open({ context, cli: environmentService.args, forceNewWindow: environmentService.args['new-window'], diffMode: environmentService.args.diff, initialStartup: true }); // default: read paths from cli
windowsMainService.open({ context, cli: environmentService.args, forceNewWindow: environmentService.args['new-window'] || environmentService.args['new-window-if-not-first'], diffMode: environmentService.args.diff, initialStartup: true }); // default: read paths from cli
}
// Install Menu
+21 -15
View File
@@ -83,6 +83,7 @@ export interface IWindowConfiguration extends ParsedArgs {
isInitialStartup?: boolean;
perfStartTime?: number;
perfAppReady?: number;
perfWindowLoadTime?: number;
workspacePath?: string;
@@ -212,21 +213,6 @@ export class VSCodeWindow implements IVSCodeWindow {
this._win = new BrowserWindow(options);
this._id = this._win.id;
// TODO@joao: hook this up to some initialization routine
// this causes a race between setting the headers and doing
// a request that needs them. chances are low
getCommonHTTPHeaders().done(headers => {
if (!this._win) {
return;
}
const urls = ['https://marketplace.visualstudio.com/*', 'https://*.vsassets.io/*'];
this._win.webContents.session.webRequest.onBeforeSendHeaders({ urls }, (details, cb) => {
cb({ cancel: false, requestHeaders: objects.assign(details.requestHeaders, headers) });
});
});
if (isFullscreenOrMaximized) {
this.win.maximize();
@@ -245,6 +231,11 @@ export class VSCodeWindow implements IVSCodeWindow {
const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window');
this.setMenuBarVisibility(windowConfig && windowConfig.menuBarVisibility);
// TODO@joao: hook this up to some initialization routine
// this causes a race between setting the headers and doing
// a request that needs them. chances are low
this.setCommonHTTPHeaders();
this.registerListeners();
this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config));
@@ -260,6 +251,20 @@ export class VSCodeWindow implements IVSCodeWindow {
}
};
private setCommonHTTPHeaders(): void {
getCommonHTTPHeaders().done(headers => {
if (!this._win) {
return;
}
const urls = ['https://marketplace.visualstudio.com/*', 'https://*.vsassets.io/*'];
this._win.webContents.session.webRequest.onBeforeSendHeaders({ urls }, (details, cb) => {
cb({ cancel: false, requestHeaders: objects.assign(details.requestHeaders, headers) });
});
});
}
public hasHiddenTitleBarStyle(): boolean {
return this.hiddenTitleBarStyle;
}
@@ -502,6 +507,7 @@ export class VSCodeWindow implements IVSCodeWindow {
// Perf Counters
windowConfiguration.perfStartTime = global.perfStartTime;
windowConfiguration.perfAppReady = global.perfAppReady;
windowConfiguration.perfWindowLoadTime = Date.now();
// Config (combination of process.argv and window configuration)