File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,11 +131,16 @@ if (!IS_VANILLA) {
131131
132132 process . env . DATA_DIR = join ( app . getPath ( "userData" ) , ".." , "Vencord" ) ;
133133
134- // Monkey patch commandLine to disable WidgetLayering: Fix DevTools context menus https://github.com/electron/electron/issues/38790
134+ // Monkey patch commandLine to:
135+ // - disable WidgetLayering: Fix DevTools context menus https://github.com/electron/electron/issues/38790
136+ // - disable UseEcoQoSForBackgroundProcess: Work around Discord unloading when in background
135137 const originalAppend = app . commandLine . appendSwitch ;
136138 app . commandLine . appendSwitch = function ( ...args ) {
137- if ( args [ 0 ] === "disable-features" && ! args [ 1 ] ?. includes ( "WidgetLayering" ) ) {
138- args [ 1 ] += ",WidgetLayering" ;
139+ if ( args [ 0 ] === "disable-features" ) {
140+ const disabledFeatures = new Set ( ( args [ 1 ] ?? "" ) . split ( "," ) ) ;
141+ disabledFeatures . add ( "WidgetLayering" ) ;
142+ disabledFeatures . add ( "UseEcoQoSForBackgroundProcess" ) ;
143+ args [ 1 ] += [ ...disabledFeatures ] . join ( "," ) ;
139144 }
140145 return originalAppend . apply ( this , args ) ;
141146 } ;
You can’t perform that action at this time.
0 commit comments