From 86aabe73eb4987d4fd9a96bc528f891d1998e876 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 29 May 2024 04:24:48 +0200 Subject: [PATCH] add more flags for preventing background unloading --- src/main/patcher.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/patcher.ts b/src/main/patcher.ts index f0e3c3ab4..a3725ef9b 100644 --- a/src/main/patcher.ts +++ b/src/main/patcher.ts @@ -140,8 +140,14 @@ if (!IS_VANILLA) { return originalAppend.apply(this, args); }; + // disable renderer backgrounding to prevent the app from unloading when in the background + // https://github.com/electron/electron/issues/2822 + // https://github.com/GoogleChrome/chrome-launcher/blob/5a27dd574d47a75fec0fb50f7b774ebf8a9791ba/docs/chrome-flags-for-tools.md#task-throttling // Work around discord unloading when in background + // Discord also recently started adding these flags but only on windows for some reason dunno why, it happens on Linux too app.commandLine.appendSwitch("disable-renderer-backgrounding"); + app.commandLine.appendSwitch("disable-background-timer-throttling"); + app.commandLine.appendSwitch("disable-backgrounding-occluded-windows"); } else { console.log("[Vencord] Running in vanilla mode. Not loading Vencord"); }