From 280e24934a27557529479a70ab38c4f5fc65cb00 Mon Sep 17 00:00:00 2001 From: pengx17 Date: Wed, 31 Jul 2024 07:03:32 +0000 Subject: [PATCH] fix(electron): window theme issue after exiting presentation (#7671) --- .../electron/src/main/windows-manager/main-window.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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); });