From d259c5705328e55fbc03a8aab18b812c75ffeb7f Mon Sep 17 00:00:00 2001 From: kaitlynkittyy Date: Mon, 8 Apr 2024 22:23:25 -0400 Subject: [PATCH] only enable hardware acceleration if the user enables it in settings --- src/main/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/index.ts b/src/main/index.ts index 2ddd95b..6608e45 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -28,13 +28,15 @@ function init() { const { disableSmoothScroll, hardwareAcceleration } = Settings.store; if (hardwareAcceleration === false) app.disableHardwareAcceleration(); + if (hardwareAcceleration === true) { + app.commandLine.appendSwitch("enable-features", "VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,VaapiVideoDecoder"); + } if (disableSmoothScroll) { app.commandLine.appendSwitch("disable-smooth-scrolling"); } // work around chrome 66 disabling autoplay by default app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required"); - app.commandLine.appendSwitch("enable-features", "VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,VaapiVideoDecoder"); // WinRetrieveSuggestionsOnlyOnDemand: Work around electron 13 bug w/ async spellchecking on Windows. // HardwareMediaKeyHandling,MediaSessionService: Prevent Discord from registering as a media service. //