patched to fix the window reloading on windows

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta 2020-08-14 11:06:14 +02:00
parent 960d8dba2e
commit ee327eff18
2 changed files with 3 additions and 14 deletions

View File

@ -110,18 +110,4 @@ export class WorkspaceService extends TheiaWorkspaceService {
} }
} }
protected openWindow(uri: FileStat, options?: WorkspaceInput): void {
const workspacePath = new URI(uri.uri).path.toString();
try {
this.openNewWindow(workspacePath);
if (this.shouldPreserveWindow(options)) {
setTimeout(() => window.close(), 10);
}
} catch (error) {
// Fall back to reloading the current window in case the browser has blocked the new window
(this as any)._workspace = uri;
this.logger.error(error.toString()).then(() => this.reloadWindow());
}
}
} }

View File

@ -22,6 +22,9 @@ const { fork } = require('child_process');
const { app, dialog, shell, BrowserWindow, ipcMain, Menu, globalShortcut } = electron; const { app, dialog, shell, BrowserWindow, ipcMain, Menu, globalShortcut } = electron;
const { ElectronSecurityToken } = require('@theia/core/lib/electron-common/electron-token'); const { ElectronSecurityToken } = require('@theia/core/lib/electron-common/electron-token');
// Fix the window reloading issue, see: https://github.com/electron/electron/issues/22119
app.allowRendererProcessReuse = false;
const applicationName = `Arduino Pro IDE`; const applicationName = `Arduino Pro IDE`;
const isSingleInstance = false; const isSingleInstance = false;
const disallowReloadKeybinding = false; const disallowReloadKeybinding = false;