From d03c72a0a80d46b215d6e66ba90fdafbe1f5a108 Mon Sep 17 00:00:00 2001 From: EYHN Date: Thu, 21 Mar 2024 09:54:47 +0000 Subject: [PATCH] fix(electron): linux crash on exiting presentation mode (#6253) --- packages/frontend/electron/src/main/main-window.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/frontend/electron/src/main/main-window.ts b/packages/frontend/electron/src/main/main-window.ts index 4f067a63f..8b6147699 100644 --- a/packages/frontend/electron/src/main/main-window.ts +++ b/packages/frontend/electron/src/main/main-window.ts @@ -127,10 +127,13 @@ async function createWindow(additionalArguments: string[]) { }); browserWindow.on('leave-full-screen', () => { - // FIXME: workaround for theme bug in full screen mode - const size = browserWindow.getSize(); - browserWindow.setSize(size[0] + 1, size[1] + 1); - browserWindow.setSize(size[0], size[1]); + // seems call this too soon may cause the app to crash + setTimeout(() => { + // FIXME: workaround for theme bug in full screen mode + const size = browserWindow.getSize(); + browserWindow.setSize(size[0] + 1, size[1] + 1); + browserWindow.setSize(size[0], size[1]); + }); uiSubjects.onMaximized.next(false); });