Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions src/main/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ export function parseCommandline(argv: string[], electronIsShitHack: boolean): I
argv = electronIsShitArgumentSort(argv);
}

if (process.platform === "linux") {
const nxmArg = argv.findIndex((arg) => arg.startsWith("nxm://"));
if (nxmArg !== -1 && !(nxmArg > 1 && argv[nxmArg - 1] === "-d")) {
argv.splice(nxmArg, 0, "-d");
}
}

let version: string = "1.0.0";
try {
// won't happen in regular operation but lets us test this function outside vortex
Expand Down
20 changes: 9 additions & 11 deletions src/main/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ const handleError = (error: Error) => {
};

async function main(): Promise<void> {
if (process.env.VORTEX_E2E === "1") {
// Skip single-instance lock in e2e tests — each test worker runs its
// own Electron instance with an isolated user data directory.
} else if (!app.requestSingleInstanceLock()) {
app.disableHardwareAcceleration();
app.quit();
return;
}

// important: The following has to be synchronous!
const mainArgs = parseCommandline(process.argv, false);

Expand Down Expand Up @@ -309,17 +318,6 @@ async function main(): Promise<void> {

StylesheetCompiler.init();

if (process.env.VORTEX_E2E === "1") {
// Skip single-instance lock in e2e tests — each test worker runs its
// own Electron instance with an isolated user data directory.
} else if (!app.requestSingleInstanceLock()) {
app.disableHardwareAcceleration();
app.commandLine.appendSwitch("--in-process-gpu");
app.commandLine.appendSwitch("--disable-software-rasterizer");
app.quit();
return;
}

// async code only allowed from here on out

try {
Expand Down