Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(electron): window theme issue after exiting presentation (#7671)

pengx17280e24934a27
diff --git a/packages/frontend/electron/src/main/windows-manager/main-window.ts b/packages/frontend/electron/src/main/windows-manager/main-window.ts
index 846b8cb995..65eff862d2 100644
--- a/packages/frontend/electron/src/main/windows-manager/main-window.ts
+++ b/packages/frontend/electron/src/main/windows-manager/main-window.ts
@@ -143,14 +143,19 @@ export class MainWindowManager {
}
});
- mainWindow.on('leave-full-screen', () => {
- // seems call this too soon may cause the app to crash
+ const refreshBound = (timeout = 0) => {
setTimeout(() => {
// FIXME: workaround for theme bug in full screen mode
const size = mainWindow.getSize();
mainWindow.setSize(size[0] + 1, size[1] + 1);
mainWindow.setSize(size[0], size[1]);
- });
+ }, timeout);
+ };
+
+ mainWindow.on('leave-full-screen', () => {
+ // seems call this too soon may cause the app to crash
+ refreshBound();
+ refreshBound(1000);
uiSubjects.onMaximized$.next(false);
uiSubjects.onFullScreen$.next(false);
});