Introduce --enable-gpu flag on Linux

This commit is contained in:
Fedor Indutny 2022-11-14 11:29:53 -08:00 committed by GitHub
parent 6b42a69947
commit 4c622b6f81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -161,6 +161,9 @@ const defaultWebPrefs = {
spellcheck: false, spellcheck: false,
}; };
const DISABLE_GPU =
OS.isLinux() && !process.argv.some(arg => arg === '--enable-gpu');
function showWindow() { function showWindow() {
if (!mainWindow) { if (!mainWindow) {
return; return;
@ -1610,7 +1613,7 @@ app.commandLine.appendSwitch('password-store', 'basic');
// <canvas/> rendering is often utterly broken on Linux when using GPU // <canvas/> rendering is often utterly broken on Linux when using GPU
// acceleration. // acceleration.
if (OS.isLinux()) { if (DISABLE_GPU) {
app.disableHardwareAcceleration(); app.disableHardwareAcceleration();
} }