fix: App-maximized-2nd-monitor
Signed-off-by: Mihai <cristian@mihaimuresan.com>
This commit is contained in:
parent
b765e84151
commit
e18e89d6f0
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue