From 16d77aebddb83612985cebedc67596ff6ffa584c Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Wed, 11 Jan 2023 21:31:23 +0100 Subject: [PATCH] fixes electron flashing white screen on startup (#1919) --- CHANGELOG.md | 1 + js/electron.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80f9d868c5..c76a021824 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ _This release is scheduled to be released on 2023-04-01._ - Fix wrong day labels in envcanada forecast (#2987) - Fix for missing default class name prefix for customEvents in calendar +- Fixed electron flashing white screen on startup (#1919) - Fix weathergov provider hourly forecast (#3008) - Fix message display with HTML code into alert module (#2828) - Fix typo into french translation diff --git a/js/electron.js b/js/electron.js index ac58657c30..9e4d3f5e24 100644 --- a/js/electron.js +++ b/js/electron.js @@ -46,8 +46,10 @@ function createWindow() { if (config.kioskmode) { electronOptionsDefaults.kiosk = true; } else { - electronOptionsDefaults.fullscreen = true; - electronOptionsDefaults.autoHideMenuBar = true; + electronOptionsDefaults.show = false; + electronOptionsDefaults.frame = false; + electronOptionsDefaults.transparent = true; + electronOptionsDefaults.hasShadow = false; } const electronOptions = Object.assign({}, electronOptionsDefaults, config.electronOptions); @@ -117,6 +119,11 @@ function createWindow() { callback({ responseHeaders: curHeaders }); }); + + mainWindow.once("ready-to-show", () => { + mainWindow.setFullScreen(true); + mainWindow.show(); + }); } // This method will be called when Electron has finished