Refactor window creation and maximize logic
This commit is contained in:
parent
2693ed79fd
commit
5e31cdd825
1 changed files with 7 additions and 5 deletions
|
@ -453,12 +453,8 @@ export async function createWindows() {
|
||||||
|
|
||||||
mainWin.webContents.on("did-finish-load", () => {
|
mainWin.webContents.on("did-finish-load", () => {
|
||||||
splash.destroy();
|
splash.destroy();
|
||||||
if (!startMinimized) mainWin!.show();
|
|
||||||
|
|
||||||
if (Settings.store.maximized && !isDeckGameMode) {
|
if (!startMinimized || isDeckGameMode) mainWin!.show();
|
||||||
mainWin!.maximize();
|
|
||||||
if (startMinimized) mainWin!.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isDeckGameMode) {
|
if (isDeckGameMode) {
|
||||||
// always use entire display
|
// always use entire display
|
||||||
|
@ -468,5 +464,11 @@ export async function createWindows() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mainWin.once("show", () => {
|
||||||
|
if (Settings.store.maximized && !mainWin!.isMaximized() && !isDeckGameMode) {
|
||||||
|
mainWin!.maximize();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
initArRPC();
|
initArRPC();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue