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"); }