diff --git a/electron/gameWindow.js b/electron/gameWindow.js index e114a6b1d..598ec95dd 100644 --- a/electron/gameWindow.js +++ b/electron/gameWindow.js @@ -44,6 +44,9 @@ async function createWindow(killall) { window.removeMenu(); noScripts = killall ? { query: { noScripts: killall } } : {}; window.loadFile("index.html", noScripts); + window.once("ready-to-show", () => { + utils.setZoomFactor(window, utils.getZoomFactor()); + }); window.show(); if (debug) window.webContents.openDevTools(); @@ -60,7 +63,6 @@ async function createWindow(killall) { achievements.enableAchievementsInterval(window); utils.attachUnresponsiveAppHandler(window); - utils.setZoomFactor(window); try { await api.initialize(window); diff --git a/electron/menu.js b/electron/menu.js index f0a233218..ca93d5304 100644 --- a/electron/menu.js +++ b/electron/menu.js @@ -212,7 +212,7 @@ function getMenu(window) { click: () => window.loadFile("index.html"), }, { - label: "Reload & Kill All Scripts", + label: "Reload && Kill All Scripts", click: () => utils.reloadAndKill(window, true), }, ], diff --git a/electron/utils.js b/electron/utils.js index 83f1f8700..5cd1d61e0 100644 --- a/electron/utils.js +++ b/electron/utils.js @@ -7,8 +7,12 @@ const store = new Store(); function reloadAndKill(window, killScripts) { log.info("Reloading & Killing all scripts..."); + const zoomFactor = getZoomFactor(); window.webContents.forcefullyCrashRenderer(); window.loadFile("index.html", killScripts ? { query: { noScripts: true } } : {}); + window.once("ready-to-show", () => { + setZoomFactor(window, zoomFactor); + }); } function promptForReload(window) {