From 7764f2512aac7af8ec008c49eb4d9b815c4f05f1 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 6 Sep 2026 02:50:21 +0200 Subject: [PATCH] Remove flags that disable renderer backgrounding We added these in the past to work around issues where Vesktop would go blank while backgrounded. The issue is likely fixed now, at least I cannot reproduce. The best way to test it out is to just remove them and see if anyone complains :P Also adds back the bandai fix for the obscure app-region bug which was removed in an earlier commit. Turns out this is still a bug.' ' --- src/Vencord.ts | 1 + src/fixWeirdAppRegionBug.css | 4 ++++ src/main/patcher.ts | 23 ----------------------- 3 files changed, 5 insertions(+), 23 deletions(-) create mode 100644 src/fixWeirdAppRegionBug.css diff --git a/src/Vencord.ts b/src/Vencord.ts index 21d81f75f..17790136d 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -18,6 +18,7 @@ // DO NOT REMOVE UNLESS YOU WISH TO FACE THE WRATH OF THE CIRCULAR DEPENDENCY DEMON!!!!!!! import "~plugins"; +import "./fixWeirdAppRegionBug.css"; export * as Api from "./api"; export * as Plugins from "./api/PluginManager"; diff --git a/src/fixWeirdAppRegionBug.css b/src/fixWeirdAppRegionBug.css new file mode 100644 index 000000000..d850e0468 --- /dev/null +++ b/src/fixWeirdAppRegionBug.css @@ -0,0 +1,4 @@ +/* Works around a very strange issue where *something* (electron?) will inject body { app-region: drag } when using online themes */ +body { + app-region: unset; +} \ No newline at end of file diff --git a/src/main/patcher.ts b/src/main/patcher.ts index dcaec468d..42083f655 100644 --- a/src/main/patcher.ts +++ b/src/main/patcher.ts @@ -79,8 +79,6 @@ if (!IS_VANILLA) { const original = options.webPreferences.preload; options.webPreferences.preload = join(__dirname, "preload.js"); options.webPreferences.sandbox = false; - // work around discord unloading when in background - options.webPreferences.backgroundThrottling = false; if (frameless) { options.frame = false; @@ -136,27 +134,6 @@ if (!IS_VANILLA) { }); process.env.DATA_DIR = join(app.getPath("userData"), "..", "Vencord"); - - // Monkey patch commandLine to: - // - disable UseEcoQoSForBackgroundProcess: Work around Discord unloading when in background - const originalAppend = app.commandLine.appendSwitch; - app.commandLine.appendSwitch = function (...args) { - if (args[0] === "disable-features") { - const disabledFeatures = new Set((args[1] ?? "").split(",")); - disabledFeatures.add("UseEcoQoSForBackgroundProcess"); - args[1] += [...disabledFeatures].join(","); - } - 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"); }