Skip to content

Commit

Permalink
Fixes #134612: Added electron flags for wayland
Browse files Browse the repository at this point in the history
ozone-platform flag will be parsed from runtime argv.json file.
  • Loading branch information
zzeebbii committed Nov 9, 2021
1 parent 799d82f commit e67c2e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.js
Expand Up @@ -167,6 +167,9 @@ function configureCommandlineSwitchesSync(cliArgs) {

// Force enable screen readers on Linux via this flag
SUPPORTED_ELECTRON_SWITCHES.push('force-renderer-accessibility');

// Specify ozone platform implementation to use.
SUPPORTED_ELECTRON_SWITCHES.push('ozone-platform');
}

const SUPPORTED_MAIN_PROCESS_SWITCHES = [
Expand Down Expand Up @@ -194,14 +197,19 @@ function configureCommandlineSwitchesSync(cliArgs) {
}
}

// Others
// Other 'enabled' flags
else if (argvValue === true || argvValue === 'true') {
if (argvKey === 'disable-hardware-acceleration') {
app.disableHardwareAcceleration(); // needs to be called explicitly
} else {
app.commandLine.appendSwitch(argvKey);
}
}

// Other arguments with value type as 'string'
else if (typeof argvValue === 'string') {
app.commandLine.appendSwitch(argvKey, argvValue);
}
}

// Append main process flags to process.argv
Expand Down
4 changes: 4 additions & 0 deletions src/vs/workbench/electron-sandbox/desktop.contribution.ts
Expand Up @@ -317,6 +317,10 @@ import { TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry';
type: 'boolean',
description: localize('argv.force-renderer-accessibility', 'Forces the renderer to be accessible. ONLY change this if you are using a screen reader on Linux. On other platforms the renderer will automatically be accessible. This flag is automatically set if you have editor.accessibilitySupport: on.'),
};
schema.properties!['ozone-platform'] = {
type: 'string',
description: localize('argv.ozone-platform', "Configures the ozone platform implementation to be used by the runtime. Allowed values are 'wayland', 'x11'."),
};
}

jsonRegistry.registerSchema(argvDefinitionFileSchemaId, schema);
Expand Down

0 comments on commit e67c2e8

Please sign in to comment.