From 1c0bfe6b83a90aadfd10dfd2b78a6411d04cec23 Mon Sep 17 00:00:00 2001 From: sp1cyf0x Date: Mon, 8 Jan 2024 10:39:40 +0000 Subject: [PATCH 1/3] Fix hardware acceleration flags --- src/main/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 0ca9917a3c86d..4bf1d885e767c 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -166,9 +166,11 @@ function runApp() { let mainWindow let startupUrl - app.commandLine.appendSwitch('enable-accelerated-video-decode') - app.commandLine.appendSwitch('enable-file-cookies') - app.commandLine.appendSwitch('ignore-gpu-blacklist') + // Enable hardware acceleration via VA-API + // https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md + app.commandLine.appendSwitch('use-gl', 'angle') + app.commandLine.appendSwitch('use-angle', 'gl') + app.commandLine.appendSwitch('enable-features', 'VaapiVideoDecodeLinuxGL') // Work around for context menus in the devtools being displayed behind the window // https://github.com/electron/electron/issues/38790 From 280df1b029fb3ed7a2151c89388bd6336c02cad1 Mon Sep 17 00:00:00 2001 From: sp1cyf0x Date: Mon, 8 Jan 2024 11:56:32 +0000 Subject: [PATCH 2/3] Update index.js --- src/main/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 4bf1d885e767c..a4b5d8b4fbc1a 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -168,8 +168,6 @@ function runApp() { // Enable hardware acceleration via VA-API // https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md - app.commandLine.appendSwitch('use-gl', 'angle') - app.commandLine.appendSwitch('use-angle', 'gl') app.commandLine.appendSwitch('enable-features', 'VaapiVideoDecodeLinuxGL') // Work around for context menus in the devtools being displayed behind the window From 4fb58dd864981f259356e9ee45fed09dc07c6fda Mon Sep 17 00:00:00 2001 From: sp1cyf0x Date: Mon, 8 Jan 2024 18:40:16 +0000 Subject: [PATCH 3/3] Make flag only enabled on Linux Co-authored-by: absidue <48293849+absidue@users.noreply.github.com> --- src/main/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index a4b5d8b4fbc1a..629ef69f04b18 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -166,9 +166,11 @@ function runApp() { let mainWindow let startupUrl - // Enable hardware acceleration via VA-API - // https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md - app.commandLine.appendSwitch('enable-features', 'VaapiVideoDecodeLinuxGL') + if (process.platform === 'linux') { + // Enable hardware acceleration via VA-API + // https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md + app.commandLine.appendSwitch('enable-features', 'VaapiVideoDecodeLinuxGL') + } // Work around for context menus in the devtools being displayed behind the window // https://github.com/electron/electron/issues/38790