fix: To avoid a flash when opening your menubar app, you can disable backgrounding the app

This commit is contained in:
林一二 2021-10-27 00:18:40 +08:00
parent 3081be133b
commit cc61a2dfa9

View file

@ -83,6 +83,9 @@ export class Window implements IWindowService {
public async close(windowName: WindowNames): Promise<void> {
this.get(windowName)?.close();
if (windowName === WindowNames.menuBar) {
this.mainWindowMenuBar?.app?.hide?.();
}
}
public async open<N extends WindowNames>(
@ -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) {