mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 06:51:53 +01:00
✨ command to toggle shared process
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user