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.' '
This commit is contained in:
parent
af114dab7c
commit
7764f2512a
3 changed files with 5 additions and 23 deletions
|
|
@ -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";
|
||||
|
|
|
|||
4
src/fixWeirdAppRegionBug.css
Normal file
4
src/fixWeirdAppRegionBug.css
Normal file
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue