Skip to content

Commit

Permalink
main: do not override enable-features
Browse files Browse the repository at this point in the history
  • Loading branch information
takase1121 committed Apr 21, 2024
1 parent ab9e857 commit 9d37683
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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";

Expand Down

0 comments on commit 9d37683

Please sign in to comment.