fix: App-maximized-2nd-monitor

Signed-off-by: Mihai <cristian@mihaimuresan.com>
This commit is contained in:
Mihai 2026-02-14 05:22:49 +01:00
parent b765e84151
commit e18e89d6f0
1 changed files with 15 additions and 9 deletions

View File

@ -57,19 +57,25 @@ export function createMainWindow() {
// hide the options // hide the options
mainWindow.setMenu(null); mainWindow.setMenu(null);
// maximise the window if it was maximised before
if (config.windowState.isMaximised) {
mainWindow.maximize();
}
// restore last position if it was moved previously // restore last position if it was moved previously
if(config.windowState.x > 0 || config.windowState.y > 0) { if (config.windowState.x > 0 || config.windowState.y > 0) {
mainWindow.setPosition(config.windowState.x ?? 0, config.windowState.y ?? 0); mainWindow.setPosition(
config.windowState.x ?? 0,
config.windowState.y ?? 0,
);
} }
// restore last size if it was resized previously // restore last size if it was resized previously
if(config.windowState.width > 0 && config.windowState.height > 0) { if (config.windowState.width > 0 && config.windowState.height > 0) {
mainWindow.setSize(config.windowState.width ?? 1280, config.windowState.height ?? 720); mainWindow.setSize(
config.windowState.width ?? 1280,
config.windowState.height ?? 720,
);
}
// maximise the window if it was maximised before
if (config.windowState.isMaximised) {
mainWindow.maximize();
} }
// load the entrypoint // load the entrypoint