From 18061094acef1bf0e8c44978c319bad563cc981a Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 18 Dec 2020 10:59:48 -0800 Subject: [PATCH] Fix restore from tray on second instance RPS-69 --- electron/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/electron/main.js b/electron/main.js index d71da0a..a7445f5 100644 --- a/electron/main.js +++ b/electron/main.js @@ -119,8 +119,8 @@ function createWindow() { // Create the browser window. Menu.setApplicationMenu(menu); mainWindow = new BrowserWindow({ - width: 800, - height: 600, + // width: 800, + // height: 600, title: `ImEX RPS ${app.getVersion()}`, icon: path.join(__dirname, "../src/assets/logo192.png"), webPreferences: { @@ -141,6 +141,7 @@ function createWindow() { // Someone tried to run a second instance, we should focus our window. if (mainWindow) { if (mainWindow.isMinimized()) mainWindow.restore(); + mainWindow.show(); mainWindow.focus(); } }); @@ -228,6 +229,7 @@ app.on("window-all-closed", () => { app.on("activate", () => { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. + console.log("Activate"); if (BrowserWindow.getAllWindows().length === 0) { createWindow(); }