diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index 68cc0cb..2561c43 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -446,7 +446,8 @@ function createMainWindow() { const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDesktopMain.js"))); export async function createWindows() { - const splash = createSplashWindow(); + const startMinimized = process.argv.includes("--start-minimized"); + const splash = createSplashWindow(startMinimized); // SteamOS letterboxes and scales it terribly, so just full screen it if (isDeckGameMode) splash.setFullScreen(true); await ensureVencordFiles(); @@ -456,10 +457,10 @@ export async function createWindows() { mainWin.webContents.on("did-finish-load", () => { splash.destroy(); - mainWin!.show(); - if (State.store.maximized && !isDeckGameMode) { - mainWin!.maximize(); + if (!startMinimized) { + mainWin!.show(); + if (State.store.maximized && !isDeckGameMode) mainWin!.maximize(); } if (isDeckGameMode) { @@ -468,6 +469,12 @@ export async function createWindows() { askToApplySteamLayout(mainWin); } + + mainWin.once("show", () => { + if (State.store.maximized && !mainWin!.isMaximized() && !isDeckGameMode) { + mainWin!.maximize(); + } + }); }); initArRPC(); diff --git a/src/main/splash.ts b/src/main/splash.ts index f21799d..7c05de9 100644 --- a/src/main/splash.ts +++ b/src/main/splash.ts @@ -11,10 +11,11 @@ import { ICON_PATH, VIEW_DIR } from "shared/paths"; import { Settings } from "./settings"; -export function createSplashWindow() { +export function createSplashWindow(startMinimized = false) { const splash = new BrowserWindow({ ...SplashProps, - icon: ICON_PATH + icon: ICON_PATH, + show: !startMinimized }); splash.loadFile(join(VIEW_DIR, "splash.html"));