Merge branch 'master' into shared-process

This commit is contained in:
João Moreno
2017-03-06 15:09:17 +01:00
387 changed files with 4789 additions and 2853 deletions

View File

@@ -1064,11 +1064,11 @@ export class VSCodeMenu {
// the keybinding is not native so we cannot show it as part of the accelerator of
// the menu item. we fallback to a different strategy so that we always display it
else {
const bindingIndex = options.label.indexOf('');
const bindingIndex = options.label.indexOf('(');
if (bindingIndex >= 0) {
options.label = `${options.label.substr(0, bindingIndex)} ${binding.label}`;
options.label = `${options.label.substr(0, bindingIndex)} (${binding.label})`;
} else {
options.label = `${options.label} ${binding.label}`;
options.label = `${options.label} (${binding.label})`;
}
}
}

View File

@@ -141,6 +141,8 @@ export class WindowsManager implements IWindowsMainService {
private windowsState: IWindowsState;
private lastClosedWindowState: IWindowState;
private firstWindowLoading: boolean;
private _onRecentPathsChange = new Emitter<void>();
onRecentPathsChange: CommonEvent<void> = this._onRecentPathsChange.event;
@@ -171,8 +173,6 @@ export class WindowsManager implements IWindowsMainService {
this.initialUserEnv = initialUserEnv;
this.windowsState = this.storageService.getItem<IWindowsState>(WindowsManager.windowsStateStorageKey) || { openedFolders: [] };
this.updateWindowsJumpList();
}
private registerListeners(): void {
@@ -862,6 +862,7 @@ export class WindowsManager implements IWindowsMainService {
vscodeWindow.win.webContents.removeAllListeners('devtools-reload-page'); // remove built in listener so we can handle this on our own
vscodeWindow.win.webContents.on('devtools-reload-page', () => this.reload(vscodeWindow));
vscodeWindow.win.webContents.on('crashed', () => this.onWindowError(vscodeWindow, WindowError.CRASHED));
vscodeWindow.win.webContents.on('did-start-loading', () => this.onWindowStartLoading(vscodeWindow));
vscodeWindow.win.on('unresponsive', () => this.onWindowError(vscodeWindow, WindowError.UNRESPONSIVE));
vscodeWindow.win.on('closed', () => this.onWindowClosed(vscodeWindow));
@@ -1264,11 +1265,26 @@ export class WindowsManager implements IWindowsMainService {
return pathA === pathB;
}
private onWindowStartLoading(win: VSCodeWindow): void {
if (!this.firstWindowLoading) {
this.firstWindowLoading = true;
// Apply jump list when our first window is loading. We do this because
// setJumpList() seems to take quite a bit of time and would block window
// loading ( = startup performance) significantly otherwise
setTimeout(() => this.updateWindowsJumpList()); // unwind from onWindowStartLoading event
}
}
private updateWindowsJumpList(): void {
if (!platform.isWindows) {
return; // only on windows
}
if (!this.firstWindowLoading) {
return; // push this out until a window starts loading for perf reasons
}
const jumpList: Electron.JumpListCategory[] = [];
// Tasks