Skip to content

Commit b0beea8

Browse files
committed
fix: show Windows reader after renderer finishes loading
1 parent ba5a488 commit b0beea8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎electron/main.mjs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,14 +909,18 @@ else {
909909
window.webContents.on('will-navigate', (event, url) => {
910910
if (new URL(url).origin !== backend.origin) event.preventDefault();
911911
});
912-
window.once('ready-to-show', () => {
912+
const showLoadedWindow = () => {
913913
hideNativeMenuBar(window);
914-
if (!backgroundRenderSmoke) {
914+
if (!backgroundRenderSmoke && !window.isVisible()) {
915915
if (process.argv.includes('--background')) window.showInactive();
916916
else window.show();
917917
}
918918
updatePerformanceSampling(window);
919-
});
919+
};
920+
window.once('ready-to-show', showLoadedWindow);
921+
// Windows may finish loading the renderer without painting a hidden window.
922+
// Show the actual application after load as well, preserving background tests.
923+
if (process.platform === 'win32') window.webContents.once('did-finish-load', showLoadedWindow);
920924
window.on('focus', () => {
921925
updateAppearance();
922926
rebuildMenu();

0 commit comments

Comments
 (0)