From 9d376832d13e412b24ca9fc9e2b8829803c6083a Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Sat, 20 Apr 2024 23:21:01 +0800 Subject: [PATCH] main: do not override enable-features --- src/main/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/index.ts b/src/main/index.ts index 325d417..d06da2b 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -27,10 +27,12 @@ process.env.VENCORD_USER_DATA_DIR = DATA_DIR; function init() { const { disableSmoothScroll, hardwareAcceleration } = Settings.store; + const enableFeatures: string[] = []; + if (hardwareAcceleration === false) { app.disableHardwareAcceleration(); } else { - app.commandLine.appendSwitch("enable-features", "VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,VaapiVideoDecoder"); + enableFeatures.push("VaapiVideoDecodeLinuxGL", "VaapiVideoEncoder", "VaapiVideoDecoder"); } if (disableSmoothScroll) { @@ -48,6 +50,11 @@ function init() { "WinRetrieveSuggestionsOnlyOnDemand,HardwareMediaKeyHandling,MediaSessionService,WidgetLayering" ); + // don't overwrite command-line supplied switches + if (!app.commandLine.hasSwitch("enable-features")) { + app.commandLine.appendSwitch("enable-features", enableFeatures.join(",")); + } + // In the Flatpak on SteamOS the theme is detected as light, but SteamOS only has a dark mode, so we just override it if (isDeckGameMode) nativeTheme.themeSource = "dark";