Skip to content

Commit

Permalink
Prevent electron flashing white screen on startup (#3001)
Browse files Browse the repository at this point in the history
see #1919

thanks @dfanica for providing the solution in [this
comment](#1919 (comment))

tested this on a pi4 with bullseye 32-bit and 64-bit
  • Loading branch information
khassel authored Jan 26, 2023
1 parent ed90f05 commit 42d42ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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
Expand Down
11 changes: 9 additions & 2 deletions js/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 42d42ef

Please sign in to comment.