From 93e4c1b1230ce7285144cc12ae8c6160645ece4e Mon Sep 17 00:00:00 2001 From: devDefiWeb Date: Mon, 2 Nov 2020 19:45:12 +0300 Subject: [PATCH] make sure "ready-to-show" handler kicks in only once * some time ago @electron made "ready-to-show" event to be fired multiple times which goes against their documentation (possibly caused by https://github.com/electron/electron/pull/25448) and so was causing the annoying windows flickering in the app --- src/electron-main/window/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/electron-main/window/main.ts b/src/electron-main/window/main.ts index 92b0940e..b6f8bea0 100644 --- a/src/electron-main/window/main.ts +++ b/src/electron-main/window/main.ts @@ -140,7 +140,7 @@ export async function initMainBrowserWindow(ctx: Context): Promise { + .once("ready-to-show", async () => { const boundsToRestore = await resolveBoundsToRestore(ctx, browserWindow.getBounds()); logger.verbose(JSON.stringify({boundsToRestore}));