From e67c2e80fdb8649c6c9ba6ec043b0dea21872f37 Mon Sep 17 00:00:00 2001 From: Muhammad Zohaib Aslam Date: Fri, 15 Oct 2021 21:55:01 +0000 Subject: [PATCH] Fixes #134612: Added electron flags for wayland ozone-platform flag will be parsed from runtime argv.json file. --- src/main.js | 10 +++++++++- .../workbench/electron-sandbox/desktop.contribution.ts | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index ad838aa245e2e..40d86cf4b1b92 100644 --- a/src/main.js +++ b/src/main.js @@ -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 = [ @@ -194,7 +197,7 @@ 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 @@ -202,6 +205,11 @@ function configureCommandlineSwitchesSync(cliArgs) { 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 diff --git a/src/vs/workbench/electron-sandbox/desktop.contribution.ts b/src/vs/workbench/electron-sandbox/desktop.contribution.ts index 67218f026b83d..12080419d061d 100644 --- a/src/vs/workbench/electron-sandbox/desktop.contribution.ts +++ b/src/vs/workbench/electron-sandbox/desktop.contribution.ts @@ -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);