From ee327eff1834a53f705fd46fd7ebb3785a905154 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 14 Aug 2020 11:06:14 +0200 Subject: [PATCH] patched to fix the window reloading on windows Signed-off-by: Akos Kitta --- .../browser/theia/workspace/workspace-service.ts | 14 -------------- electron/build/patch/electron-main.js | 3 +++ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/arduino-ide-extension/src/browser/theia/workspace/workspace-service.ts b/arduino-ide-extension/src/browser/theia/workspace/workspace-service.ts index 283ab837..1e10702a 100644 --- a/arduino-ide-extension/src/browser/theia/workspace/workspace-service.ts +++ b/arduino-ide-extension/src/browser/theia/workspace/workspace-service.ts @@ -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()); - } - } - } diff --git a/electron/build/patch/electron-main.js b/electron/build/patch/electron-main.js index 7d98fb0d..4e642ba5 100644 --- a/electron/build/patch/electron-main.js +++ b/electron/build/patch/electron-main.js @@ -22,6 +22,9 @@ const { fork } = require('child_process'); const { app, dialog, shell, BrowserWindow, ipcMain, Menu, globalShortcut } = electron; 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 isSingleInstance = false; const disallowReloadKeybinding = false;