command to toggle shared process

This commit is contained in:
Joao Moreno
2017-03-06 10:55:15 +01:00
parent 31fbe0bcd6
commit b7eefb7e8c
8 changed files with 59 additions and 6 deletions

View File

@@ -155,7 +155,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
services.set(IUpdateService, new SyncDescriptor(UpdateService));
services.set(IWindowsMainService, new SyncDescriptor(WindowsManager));
services.set(IWindowsService, new SyncDescriptor(WindowsService));
services.set(IWindowsService, new SyncDescriptor(WindowsService, sharedProcess));
services.set(ILaunchService, new SyncDescriptor(LaunchService));
if (environmentService.isBuilt && !environmentService.isExtensionDevelopment && !!product.enableTelemetry) {

View File

@@ -24,8 +24,7 @@ export class SharedProcess {
const url = `${require.toUrl('vs/code/electron-browser/sharedProcess.html')}?config=${encodeURIComponent(JSON.stringify(config))}`;
this.window.loadURL(url);
// this.window.webContents.openDevTools();
this.window.hide();
this.hide();
// Prevent the window from dying
this.window.on('close', e => {
@@ -49,6 +48,24 @@ export class SharedProcess {
private nodeCachedDataDir: string
) { }
toggle(): void {
if (this.window.isVisible()) {
this.hide();
} else {
this.show();
}
}
show(): void {
this.window.show();
this.window.webContents.openDevTools();
}
hide(): void {
this.window.webContents.closeDevTools();
this.window.hide();
}
dispose(): void {
if (this.window) {
this.window.close();