From b030ca914df6dafcec13a43826b7f254f0cd59d6 Mon Sep 17 00:00:00 2001 From: Roman Orlowski Date: Tue, 7 Nov 2023 14:58:39 +0300 Subject: [PATCH] Desktop: Fixes #9130: Allow Electron `--disable-gpu` flag (#9179) --- packages/lib/utils/processStartFlags.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/lib/utils/processStartFlags.ts b/packages/lib/utils/processStartFlags.ts index 2bf38f1e9..bfd0f28c2 100644 --- a/packages/lib/utils/processStartFlags.ts +++ b/packages/lib/utils/processStartFlags.ts @@ -1,5 +1,3 @@ - - import Logger, { LogLevel } from '@joplin/utils/Logger'; import JoplinError from '../JoplinError'; import { _ } from '../locale'; @@ -152,6 +150,13 @@ const processStartFlags = async (argv: string[], setDefaults = true) => { continue; } + if (arg === '--disable-gpu') { + // Electron-specific flag - ignore it + // Allows users to disable GPU acceleration + argv.splice(0, 1); + continue; + } + if (arg.length && arg[0] === '-') { throw new JoplinError(_('Unknown flag: %s', arg), 'flagError'); } else {