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 15, 2021
1 parent 9472f26 commit 4116982
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 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,22 @@ 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);
}
}

// ozone platform
else if (argvKey === 'ozone-platform') {
if (argvValue) {
app.commandLine.appendSwitch(argvKey, argvValue);
app.commandLine.appendSwitch('enable-features', 'UseOzonePlatform');
}
}
}

// 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 4116982

Please sign in to comment.