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

This commit is contained in:
pengx17
2024-07-31 07:03:32 +00:00
parent 6b8f99c013
commit 280e24934a

View File

@@ -143,14 +143,19 @@ export class MainWindowManager {
} }
}); });
mainWindow.on('leave-full-screen', () => { const refreshBound = (timeout = 0) => {
// seems call this too soon may cause the app to crash
setTimeout(() => { setTimeout(() => {
// FIXME: workaround for theme bug in full screen mode // FIXME: workaround for theme bug in full screen mode
const size = mainWindow.getSize(); const size = mainWindow.getSize();
mainWindow.setSize(size[0] + 1, size[1] + 1); mainWindow.setSize(size[0] + 1, size[1] + 1);
mainWindow.setSize(size[0], size[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.onMaximized$.next(false);
uiSubjects.onFullScreen$.next(false); uiSubjects.onFullScreen$.next(false);
}); });