From cc61a2dfa96f0c6da688cf435ba395fdd95237f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=80=E4=BA=8C?= Date: Wed, 27 Oct 2021 00:18:40 +0800 Subject: [PATCH] fix: To avoid a flash when opening your menubar app, you can disable backgrounding the app --- src/services/windows/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/windows/index.ts b/src/services/windows/index.ts index 771b4428..e2bda2bd 100644 --- a/src/services/windows/index.ts +++ b/src/services/windows/index.ts @@ -83,6 +83,9 @@ export class Window implements IWindowService { public async close(windowName: WindowNames): Promise { this.get(windowName)?.close(); + if (windowName === WindowNames.menuBar) { + this.mainWindowMenuBar?.app?.hide?.(); + } } public async open( @@ -515,6 +518,7 @@ export class Window implements IWindowService { minWidth: 250, }), }); + menuBar.app.commandLine.appendSwitch('disable-backgrounding-occluded-windows', 'true'); menuBar.on('after-create-window', () => { if (menuBar.window !== undefined) {