From 67d2c454eeee7e24b544022652fb2e66ee23babd Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 5 Nov 2019 17:03:24 +0000 Subject: [PATCH] Desktop: Resolves #2031: Prevent window from being shown on startup when it should be hidden in tray --- ElectronClient/app/ElectronAppWrapper.js | 3 +++ ElectronClient/app/app.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ElectronClient/app/ElectronAppWrapper.js b/ElectronClient/app/ElectronAppWrapper.js index 01289ba6f3..4517a8c1b0 100644 --- a/ElectronClient/app/ElectronAppWrapper.js +++ b/ElectronClient/app/ElectronAppWrapper.js @@ -56,6 +56,9 @@ class ElectronAppWrapper { webPreferences: { nodeIntegration: true, }, + // We start with a hidden window, which is then made visible depending on the showTrayIcon setting + // https://github.com/laurent22/joplin/issues/2031 + show: false, }; // Linux icon workaround for bug https://github.com/electron-userland/electron-builder/issues/2098 diff --git a/ElectronClient/app/app.js b/ElectronClient/app/app.js index a24092e17d..a9fdb8d787 100644 --- a/ElectronClient/app/app.js +++ b/ElectronClient/app/app.js @@ -1252,7 +1252,9 @@ class Application extends BaseApplication { }, 1000 * 60 * 60); if (Setting.value('startMinimized') && Setting.value('showTrayIcon')) { - bridge().window().hide(); + // Keep it hidden + } else { + bridge().window().show(); } ResourceService.runInBackground();