From 247182edbf0ef07a76be4aedd492b32e6b829e36 Mon Sep 17 00:00:00 2001 From: 0xCLOVER <47456195+hexclover@users.noreply.github.com> Date: Wed, 5 Feb 2020 19:26:57 +0800 Subject: [PATCH] Desktop: Fix #2365: Ensure the main window is hidden when Joplin starts (#2432) * Ensure window is hidden when application launches * Update ElectronAppWrapper.js Co-authored-by: Laurent Cozic --- ElectronClient/app/ElectronAppWrapper.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ElectronClient/app/ElectronAppWrapper.js b/ElectronClient/app/ElectronAppWrapper.js index 5f5c97c222..635a4f6f61 100644 --- a/ElectronClient/app/ElectronAppWrapper.js +++ b/ElectronClient/app/ElectronAppWrapper.js @@ -124,6 +124,13 @@ class ElectronAppWrapper { // automatically (the listeners will be removed when the window is closed) // and restore the maximized or full screen state windowState.manage(this.win_); + + // HACK: Ensure the window is hidden, as `windowState.manage` may make the window + // visible with isMaximized set to true in window-state-${this.env_}.json. + // https://github.com/laurent22/joplin/issues/2365 + if (!windowOptions.show) { + this.win_.hide(); + } } async waitForElectronAppReady() {