Skip to content

Commit bd8349b

Browse files
authored
feat: prevent initial window state drift (#2731)
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 15bf493 commit bd8349b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/config.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ describe('main/config.ts', () => {
3535
expect(WindowConfig.webPreferences).toBeDefined();
3636
expect(WindowConfig.webPreferences.contextIsolation).toBe(true);
3737
expect(WindowConfig.webPreferences.nodeIntegration).toBe(false);
38+
expect(WindowConfig.webPreferences.backgroundThrottling).toBe(false);
3839
});
3940
});

src/main/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,9 @@ export const WindowConfig: BrowserWindowConstructorOptions = {
5252
nodeIntegration: false,
5353
// Disable web security in development to allow CORS requests
5454
webSecurity: !process.env.VITE_DEV_SERVER_URL,
55+
// Keep the renderer painting when the window is hidden so Chromium never
56+
// freezes the last frame. Without this, reopening the menubar window shows
57+
// stale notification content until the next React re-render completes.
58+
backgroundThrottling: false,
5559
},
5660
};

0 commit comments

Comments
 (0)