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", () => {
|
||||
splash.destroy();
|
||||
if (!startMinimized) mainWin!.show();
|
||||
|
||||
if (Settings.store.maximized && !isDeckGameMode) {
|
||||
mainWin!.maximize();
|
||||
if (startMinimized) mainWin!.hide();
|
||||
}
|
||||
if (!startMinimized || isDeckGameMode) mainWin!.show();
|
||||
|
||||
if (isDeckGameMode) {
|
||||
// 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();
|
||||
}
|
||||
|
|
Reference in a new issue