[enhancement]: also save fullscreen/maximize

This commit is contained in:
Kendall Garner 2024-04-06 21:14:05 -07:00
parent c0110eff82
commit 6824a5db7a
No known key found for this signature in database
GPG key ID: 18D2767419676C87
3 changed files with 18 additions and 2 deletions

View file

@ -394,6 +394,16 @@ const createWindow = async (first = true) => {
}
if (!first || !startWindowMinimized) {
const maximized = store.get('maximized');
const fullScreen = store.get('fullscreen');
if (maximized) {
mainWindow.maximize();
}
if (fullScreen) {
mainWindow.setFullScreen(true);
}
mainWindow.show();
createWinThumbarButtons();
}
@ -407,7 +417,10 @@ const createWindow = async (first = true) => {
let saved = false;
mainWindow.on('close', (event) => {
store.set('bounds', mainWindow?.getBounds());
store.set('bounds', mainWindow?.getNormalBounds());
store.set('maximized', mainWindow?.isMaximized());
store.set('fullscreen', mainWindow?.isFullScreen());
if (!exitFromTray && store.get('window_exit_to_tray')) {
if (isMacOS() && !forceQuit) {
exitFromTray = true;