From f53f870b53f27c3861dd6db7016eeab13477c904 Mon Sep 17 00:00:00 2001 From: Kylie C Date: Mon, 19 Aug 2024 22:01:07 -0400 Subject: [PATCH] Show main window earlier & adapt to splash colours --- src/main/mainWindow.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index 98ae077..ddce522 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -384,7 +384,7 @@ function initSpellCheck(win: BrowserWindow) { initSpellCheckLanguages(win, Settings.store.spellCheckLanguages); } -function createMainWindow() { +function createMainWindow(splash: boolean) { // Clear up previous settings listeners removeSettingsListeners(); removeVencordSettingsListeners(); @@ -395,8 +395,10 @@ function createMainWindow() { const noFrame = frameless === true || customTitleBar === true; + const { splashBackground, splashTheming } = Settings.store; const win = (mainWin = new BrowserWindow({ - show: false, + show: splash, + backgroundColor: splashTheming ? splashBackground : "#313338", webPreferences: { nodeIntegration: false, sandbox: false, @@ -470,7 +472,7 @@ const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDeskto export async function createWindows() { const startMinimized = process.argv.includes("--start-minimized"); const noSplash = process.argv.includes("--no-splash"); - let splash = undefined; + let splash; if (!noSplash) { splash = createSplashWindow(startMinimized); // SteamOS letterboxes and scales it terribly, so just full screen it @@ -479,15 +481,15 @@ export async function createWindows() { await ensureVencordFiles(); runVencordMain(); - mainWin = createMainWindow(); + mainWin = createMainWindow(noSplash); mainWin.webContents.on("did-finish-load", () => { if (splash) { splash.destroy(); - } + } if (!startMinimized) { - mainWin!.show(); + if (!noSplash) mainWin!.show(); if (State.store.maximized && !isDeckGameMode) mainWin!.maximize(); }