electron - allow to configure color profile for #88491

This commit is contained in:
Benjamin Pasero 2020-02-21 08:07:34 +01:00
parent 8999159f51
commit f647df6e52
2 changed files with 19 additions and 2 deletions

View file

@ -131,8 +131,12 @@ function configureCommandlineSwitchesSync(cliArgs) {
'disable-hardware-acceleration',
// provided by Electron
'disable-color-correct-rendering'
'disable-color-correct-rendering',
// override for the color profile to use
'force-color-profile'
];
if (process.platform === 'linux') {
SUPPORTED_ELECTRON_SWITCHES.push('force-renderer-accessibility');
}
@ -147,7 +151,16 @@ function configureCommandlineSwitchesSync(cliArgs) {
}
const argvValue = argvConfig[argvKey];
if (argvValue === true || argvValue === 'true') {
// Color profile
if (argvKey === 'force-color-profile') {
if (argvValue) {
app.commandLine.appendSwitch(argvKey, argvValue);
}
}
// Others
else if (argvValue === true || argvValue === 'true') {
if (argvKey === 'disable-hardware-acceleration') {
app.disableHardwareAcceleration(); // needs to be called explicitly
} else {

View file

@ -341,6 +341,10 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema';
'disable-color-correct-rendering': {
type: 'boolean',
description: nls.localize('argv.disableColorCorrectRendering', 'Resolves issues around color profile selection. ONLY change this option if you encounter graphic issues.')
},
'force-color-profile': {
type: 'string',
markdownDescription: nls.localize('argv.forceColorProfile', 'Allows to override the color profile to use. If you experience colors appear badly, try to set this to `srgb` and restart.')
}
}
};