linux: automatically set force-renderer-accessibility when user sets editor.accessibilitySupport
#90446
This commit is contained in:
parent
802fdbac9f
commit
ee74224b88
|
@ -131,7 +131,8 @@ function configureCommandlineSwitchesSync(cliArgs) {
|
||||||
'disable-hardware-acceleration',
|
'disable-hardware-acceleration',
|
||||||
|
|
||||||
// provided by Electron
|
// provided by Electron
|
||||||
'disable-color-correct-rendering'
|
'disable-color-correct-rendering',
|
||||||
|
'force-renderer-accessibility'
|
||||||
];
|
];
|
||||||
|
|
||||||
// Read argv config
|
// Read argv config
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
|
||||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
import { isEqual } from 'vs/base/common/resources';
|
import { isEqual } from 'vs/base/common/resources';
|
||||||
import { isMacintosh, isNative } from 'vs/base/common/platform';
|
import { isMacintosh, isNative, isLinux } from 'vs/base/common/platform';
|
||||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||||
|
@ -26,6 +26,7 @@ interface IConfiguration extends IWindowsConfiguration {
|
||||||
telemetry: { enableCrashReporter: boolean };
|
telemetry: { enableCrashReporter: boolean };
|
||||||
workbench: { list: { horizontalScrolling: boolean } };
|
workbench: { list: { horizontalScrolling: boolean } };
|
||||||
debug: { console: { wordWrap: boolean } };
|
debug: { console: { wordWrap: boolean } };
|
||||||
|
editor: { accessibilitySupport: 'on' | 'off' | 'auto' };
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SettingsChangeRelauncher extends Disposable implements IWorkbenchContribution {
|
export class SettingsChangeRelauncher extends Disposable implements IWorkbenchContribution {
|
||||||
|
@ -38,6 +39,7 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
|
||||||
private enableCrashReporter: boolean | undefined;
|
private enableCrashReporter: boolean | undefined;
|
||||||
private treeHorizontalScrolling: boolean | undefined;
|
private treeHorizontalScrolling: boolean | undefined;
|
||||||
private debugConsoleWordWrap: boolean | undefined;
|
private debugConsoleWordWrap: boolean | undefined;
|
||||||
|
private accessibilitySupport: 'on' | 'off' | 'auto' | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IHostService private readonly hostService: IHostService,
|
@IHostService private readonly hostService: IHostService,
|
||||||
|
@ -103,6 +105,14 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
|
||||||
this.enableCrashReporter = config.telemetry.enableCrashReporter;
|
this.enableCrashReporter = config.telemetry.enableCrashReporter;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On linux turning on accessibility support will also pass this flag to the chrome renderer, thus a restart is required
|
||||||
|
if (isLinux && typeof config.editor?.accessibilitySupport === 'string' && config.editor.accessibilitySupport !== this.accessibilitySupport) {
|
||||||
|
this.accessibilitySupport = config.editor.accessibilitySupport;
|
||||||
|
if (this.accessibilitySupport === 'on') {
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify only when changed and we are the focused window (avoids notification spam across windows)
|
// Notify only when changed and we are the focused window (avoids notification spam across windows)
|
||||||
|
|
|
@ -341,6 +341,10 @@ import product from 'vs/platform/product/common/product';
|
||||||
'disable-color-correct-rendering': {
|
'disable-color-correct-rendering': {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: nls.localize('argv.disableColorCorrectRendering', 'Resolves issues around color profile selection. ONLY change this option if you encounter graphic issues.')
|
description: nls.localize('argv.disableColorCorrectRendering', 'Resolves issues around color profile selection. ONLY change this option if you encounter graphic issues.')
|
||||||
|
},
|
||||||
|
'force-renderer-accessibility': {
|
||||||
|
type: 'boolean',
|
||||||
|
description: nls.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.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,13 +4,14 @@
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
|
import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
|
||||||
import { isWindows } from 'vs/base/common/platform';
|
import { isWindows, isLinux } from 'vs/base/common/platform';
|
||||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { AccessibilityService } from 'vs/platform/accessibility/common/accessibilityService';
|
import { AccessibilityService } from 'vs/platform/accessibility/common/accessibilityService';
|
||||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||||
|
import { IJSONEditingService } from 'vs/workbench/services/configuration/common/jsonEditing';
|
||||||
|
|
||||||
interface AccessibilityMetrics {
|
interface AccessibilityMetrics {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
|
@ -29,10 +30,18 @@ export class NodeAccessibilityService extends AccessibilityService implements IA
|
||||||
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
|
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
|
||||||
@IContextKeyService contextKeyService: IContextKeyService,
|
@IContextKeyService contextKeyService: IContextKeyService,
|
||||||
@IConfigurationService configurationService: IConfigurationService,
|
@IConfigurationService configurationService: IConfigurationService,
|
||||||
@ITelemetryService private readonly _telemetryService: ITelemetryService
|
@ITelemetryService private readonly _telemetryService: ITelemetryService,
|
||||||
|
@IJSONEditingService jsonEditingService: IJSONEditingService
|
||||||
) {
|
) {
|
||||||
super(contextKeyService, configurationService);
|
super(contextKeyService, configurationService);
|
||||||
this.setAccessibilitySupport(environmentService.configuration.accessibilitySupport ? AccessibilitySupport.Enabled : AccessibilitySupport.Disabled);
|
this.setAccessibilitySupport(environmentService.configuration.accessibilitySupport ? AccessibilitySupport.Enabled : AccessibilitySupport.Disabled);
|
||||||
|
if (isLinux) {
|
||||||
|
this._register(this.onDidChangeScreenReaderOptimized(async () => {
|
||||||
|
if (this.isScreenReaderOptimized()) {
|
||||||
|
await jsonEditingService.write(environmentService.argvResource, [{ key: 'force-renderer-accessibility', value: true }], true);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
alwaysUnderlineAccessKeys(): Promise<boolean> {
|
alwaysUnderlineAccessKeys(): Promise<boolean> {
|
||||||
|
|
Loading…
Reference in a new issue