Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add arg to ignore splash window #820

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions src/main/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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,
Expand Down Expand Up @@ -469,19 +471,25 @@ const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDeskto

export async function createWindows() {
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);
const noSplash = process.argv.includes("--no-splash");
let splash;
if (!noSplash) {
splash = createSplashWindow(startMinimized);
// SteamOS letterboxes and scales it terribly, so just full screen it
if (isDeckGameMode) splash.setFullScreen(true);
}
await ensureVencordFiles();
runVencordMain();

mainWin = createMainWindow();
mainWin = createMainWindow(noSplash);

mainWin.webContents.on("did-finish-load", () => {
splash.destroy();
if (splash) {
splash.destroy();
}

if (!startMinimized) {
mainWin!.show();
if (!noSplash) mainWin!.show();
if (State.store.maximized && !isDeckGameMode) mainWin!.maximize();
}

Expand Down