diff --git a/src/vs/code/electron-browser/workbench/workbench.js b/src/vs/code/electron-browser/workbench/workbench.js index 5a5cb8bd6e6..631ddb651e6 100644 --- a/src/vs/code/electron-browser/workbench/workbench.js +++ b/src/vs/code/electron-browser/workbench/workbench.js @@ -76,7 +76,7 @@ bootstrapWindow.load([ /** * @param {{ * partsSplashPath?: string, - * highContrast?: boolean, + * colorScheme: (1 | 2 | 3), * autoDetectHighContrast?: boolean, * extensionDevelopmentPath?: string[], * folderUri?: object, @@ -96,7 +96,7 @@ function showPartsSplash(configuration) { } // high contrast mode has been turned on from the outside, e.g. OS -> ignore stored colors and layouts - const isHighContrast = configuration.highContrast && configuration.autoDetectHighContrast; + const isHighContrast = configuration.colorScheme === 3 /* ColorScheme.HIGH_CONTRAST */ && configuration.autoDetectHighContrast; if (data && isHighContrast && data.baseTheme !== 'hc-black') { data = undefined; } diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index c95d26feb5f..0df1b6af683 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -15,7 +15,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv'; import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; import product from 'vs/platform/product/common/product'; -import { IWindowSettings, MenuBarVisibility, getTitleBarStyle, getMenuBarVisibility, zoomLevelToZoomFactor, INativeWindowConfiguration } from 'vs/platform/windows/common/windows'; +import { IWindowSettings, MenuBarVisibility, getTitleBarStyle, getMenuBarVisibility, zoomLevelToZoomFactor, INativeWindowConfiguration, ColorScheme } from 'vs/platform/windows/common/windows'; import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; import { ICodeWindow, IWindowState, WindowMode } from 'vs/platform/windows/electron-main/windows'; @@ -784,7 +784,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { windowConfiguration.fullscreen = this.isFullScreen; // Set Accessibility Config - windowConfiguration.highContrast = nativeTheme.shouldUseInvertedColorScheme || nativeTheme.shouldUseHighContrastColors; + windowConfiguration.colorScheme = (nativeTheme.shouldUseInvertedColorScheme || nativeTheme.shouldUseHighContrastColors) ? ColorScheme.HIGH_CONTRAST : nativeTheme.shouldUseDarkColors ? ColorScheme.DARK : ColorScheme.DEFAULT; windowConfiguration.autoDetectHighContrast = windowConfig?.autoDetectHighContrast ?? true; windowConfiguration.accessibilitySupport = app.accessibilitySupportEnabled; diff --git a/src/vs/platform/electron/common/electron.ts b/src/vs/platform/electron/common/electron.ts index cd4c3502b69..80a07026191 100644 --- a/src/vs/platform/electron/common/electron.ts +++ b/src/vs/platform/electron/common/electron.ts @@ -5,7 +5,7 @@ import { Event } from 'vs/base/common/event'; import { MessageBoxOptions, MessageBoxReturnValue, OpenDevToolsOptions, SaveDialogOptions, OpenDialogOptions, OpenDialogReturnValue, SaveDialogReturnValue, MouseInputEvent } from 'vs/base/parts/sandbox/common/electronTypes'; -import { IOpenedWindow, IWindowOpenable, IOpenEmptyWindowOptions, IOpenWindowOptions } from 'vs/platform/windows/common/windows'; +import { IOpenedWindow, IWindowOpenable, IOpenEmptyWindowOptions, IOpenWindowOptions, ColorScheme } from 'vs/platform/windows/common/windows'; import { INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs'; import { ISerializableCommandAction } from 'vs/platform/actions/common/actions'; @@ -34,6 +34,8 @@ export interface ICommonElectronService { readonly onOSResume: Event; + readonly onColorSchemeChange: Event; + // Window getWindows(): Promise; getWindowCount(): Promise; diff --git a/src/vs/platform/electron/electron-main/electronMainService.ts b/src/vs/platform/electron/electron-main/electronMainService.ts index deedb70ea3a..4088e35ff58 100644 --- a/src/vs/platform/electron/electron-main/electronMainService.ts +++ b/src/vs/platform/electron/electron-main/electronMainService.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; +import { Emitter, Event } from 'vs/base/common/event'; import { IWindowsMainService, ICodeWindow } from 'vs/platform/windows/electron-main/windows'; -import { MessageBoxOptions, MessageBoxReturnValue, shell, OpenDevToolsOptions, SaveDialogOptions, SaveDialogReturnValue, OpenDialogOptions, OpenDialogReturnValue, Menu, BrowserWindow, app, clipboard, powerMonitor } from 'electron'; +import { MessageBoxOptions, MessageBoxReturnValue, shell, OpenDevToolsOptions, SaveDialogOptions, SaveDialogReturnValue, OpenDialogOptions, OpenDialogReturnValue, Menu, BrowserWindow, app, clipboard, powerMonitor, nativeTheme } from 'electron'; import { OpenContext } from 'vs/platform/windows/node/window'; import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; -import { IOpenedWindow, IOpenWindowOptions, IWindowOpenable, IOpenEmptyWindowOptions } from 'vs/platform/windows/common/windows'; +import { IOpenedWindow, IOpenWindowOptions, IWindowOpenable, IOpenEmptyWindowOptions, ColorScheme } from 'vs/platform/windows/common/windows'; import { INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs'; import { isMacintosh, isWindows, isRootUser } from 'vs/base/common/platform'; import { ICommonElectronService, IOSProperties } from 'vs/platform/electron/common/electron'; @@ -38,8 +38,25 @@ export class ElectronMainService implements IElectronMainService { @IEnvironmentService private readonly environmentService: INativeEnvironmentService, @ITelemetryService private readonly telemetryService: ITelemetryService ) { + this.registerListeners(); } + private registerListeners(): void { + + // Color Scheme changes + nativeTheme.on('updated', () => { + let colorScheme = ColorScheme.DEFAULT; + if (nativeTheme.shouldUseInvertedColorScheme || nativeTheme.shouldUseHighContrastColors) { + colorScheme = ColorScheme.HIGH_CONTRAST; + } else if (nativeTheme.shouldUseDarkColors) { + colorScheme = ColorScheme.DARK; + } + + this._onColorSchemeChange.fire(colorScheme); + }); + } + + //#region Properties get windowId(): never { throw new Error('Not implemented in electron-main'); } @@ -61,6 +78,9 @@ export class ElectronMainService implements IElectronMainService { readonly onOSResume = Event.fromNodeEventEmitter(powerMonitor, 'resume'); + private readonly _onColorSchemeChange = new Emitter(); + readonly onColorSchemeChange = this._onColorSchemeChange.event; + //#endregion //#region Window diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 53c6c70334a..bdb6fbdf7f9 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -211,7 +211,7 @@ export interface IWindowConfiguration { remoteAuthority?: string; - highContrast?: boolean; + colorScheme: ColorScheme; autoDetectHighContrast?: boolean; filesToOpenOrCreate?: IPath[]; @@ -253,3 +253,21 @@ export interface INativeWindowConfiguration extends IWindowConfiguration, Native export function zoomLevelToZoomFactor(zoomLevel = 0): number { return Math.pow(1.2, zoomLevel); } + +export enum ColorScheme { + + /** + * The window should use standard colors. + */ + DEFAULT = 1, + + /** + * The window should use dark colors. + */ + DARK = 2, + + /** + * The window should use high contrast colors. + */ + HIGH_CONTRAST = 3 +} diff --git a/src/vs/platform/windows/electron-main/windowsMainService.ts b/src/vs/platform/windows/electron-main/windowsMainService.ts index a4a28cd8cd6..27381c0df22 100644 --- a/src/vs/platform/windows/electron-main/windowsMainService.ts +++ b/src/vs/platform/windows/electron-main/windowsMainService.ts @@ -14,7 +14,7 @@ import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/envi import { NativeParsedArgs } from 'vs/platform/environment/common/argv'; import { IStateService } from 'vs/platform/state/node/state'; import { CodeWindow, defaultWindowState } from 'vs/code/electron-main/window'; -import { screen, BrowserWindow, MessageBoxOptions, Display, app, nativeTheme } from 'electron'; +import { screen, BrowserWindow, MessageBoxOptions, Display, app } from 'electron'; import { ILifecycleMainService, UnloadReason, LifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService } from 'vs/platform/log/common/log'; @@ -209,17 +209,6 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic private registerListeners(): void { - // React to HC color scheme changes (Windows, macOS) - if (isWindows || isMacintosh) { - nativeTheme.on('updated', () => { - if (nativeTheme.shouldUseInvertedColorScheme || nativeTheme.shouldUseHighContrastColors) { - this.sendToAll('vscode:enterHighContrast'); - } else { - this.sendToAll('vscode:leaveHighContrast'); - } - }); - } - // When a window looses focus, save all windows state. This allows to // prevent loss of window-state data when OS is restarted without properly // shutting down the application (https://github.com/microsoft/vscode/issues/87171) diff --git a/src/vs/workbench/electron-sandbox/window.ts b/src/vs/workbench/electron-sandbox/window.ts index 05291244456..3e0a8c48fcd 100644 --- a/src/vs/workbench/electron-sandbox/window.ts +++ b/src/vs/workbench/electron-sandbox/window.ts @@ -13,7 +13,7 @@ import { IFileService } from 'vs/platform/files/common/files'; import { toResource, IUntitledTextResourceEditorInput, SideBySideEditor, pathsToEditors } from 'vs/workbench/common/editor'; import { IEditorService, IResourceEditorInputType } from 'vs/workbench/services/editor/common/editorService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IOpenFileRequest, IWindowsConfiguration, getTitleBarStyle, IAddFoldersRequest, INativeRunActionInWindowRequest, INativeRunKeybindingInWindowRequest, INativeOpenFileRequest } from 'vs/platform/windows/common/windows'; +import { IOpenFileRequest, IWindowsConfiguration, getTitleBarStyle, IAddFoldersRequest, INativeRunActionInWindowRequest, INativeRunKeybindingInWindowRequest, INativeOpenFileRequest, ColorScheme } from 'vs/platform/windows/common/windows'; import { ITitleService } from 'vs/workbench/services/title/common/titleService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { applyZoom } from 'vs/platform/windows/electron-sandbox/window'; @@ -199,15 +199,10 @@ export class NativeWindow extends Disposable { }); // High Contrast Events - ipcRenderer.on('vscode:enterHighContrast', async () => { + this._register(this.electronService.onColorSchemeChange(async scheme => { await this.lifecycleService.when(LifecyclePhase.Ready); - this.themeService.setOSHighContrast(true); - }); - - ipcRenderer.on('vscode:leaveHighContrast', async () => { - await this.lifecycleService.when(LifecyclePhase.Ready); - this.themeService.setOSHighContrast(false); - }); + this.themeService.setOSHighContrast(scheme === ColorScheme.HIGH_CONTRAST); + })); // accessibility support changed event ipcRenderer.on('vscode:accessibilitySupportChanged', (event: unknown, accessibilitySupportEnabled: boolean) => { diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts index e93d8fefadc..51d4e2d2384 100644 --- a/src/vs/workbench/services/environment/browser/environmentService.ts +++ b/src/vs/workbench/services/environment/browser/environmentService.ts @@ -8,7 +8,7 @@ import { joinPath } from 'vs/base/common/resources'; import { URI } from 'vs/base/common/uri'; import { generateUuid } from 'vs/base/common/uuid'; import { BACKUPS, IExtensionHostDebugParams } from 'vs/platform/environment/common/environment'; -import { IPath } from 'vs/platform/windows/common/windows'; +import { ColorScheme, IPath } from 'vs/platform/windows/common/windows'; import { IWorkbenchEnvironmentService, IWorkbenchConfiguration } from 'vs/workbench/services/environment/common/environmentService'; import { IWorkbenchConstructionOptions as IWorkbenchOptions } from 'vs/workbench/workbench.web.api'; import product from 'vs/platform/product/common/product'; @@ -74,8 +74,13 @@ class BrowserWorkbenchConfiguration implements IWorkbenchConfiguration { return undefined; } - get highContrast() { - return false; // could investigate to detect high contrast theme automatically + // TODO@martin TODO@ben this currently does not support high-contrast theme preference (no browser support yet) + get colorScheme() { + if (window.matchMedia(`(prefers-color-scheme: dark)`).matches) { + return ColorScheme.DARK; + } + + return ColorScheme.DEFAULT; } } diff --git a/src/vs/workbench/services/host/browser/browserHostService.ts b/src/vs/workbench/services/host/browser/browserHostService.ts index c4f72f05518..2c81c587686 100644 --- a/src/vs/workbench/services/host/browser/browserHostService.ts +++ b/src/vs/workbench/services/host/browser/browserHostService.ts @@ -84,6 +84,8 @@ export class BrowserHostService extends Disposable implements IHostService { } } + //#region Focus + @memoize get onDidChangeFocus(): Event { const focusTracker = this._register(trackFocus(window)); @@ -107,6 +109,11 @@ export class BrowserHostService extends Disposable implements IHostService { window.focus(); } + //#endregion + + + //#region Window + openWindow(options?: IOpenEmptyWindowOptions): Promise; openWindow(toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise; openWindow(arg1?: IOpenEmptyWindowOptions | IWindowOpenable[], arg2?: IOpenWindowOptions): Promise { @@ -320,6 +327,23 @@ export class BrowserHostService extends Disposable implements IHostService { } } + //#endregion + + + //#region Color Scheme + + // TODO@martin TODO@ben this currently does not support detecting changes + onDidChangeColorScheme = Event.None; + + get colorScheme() { + return this.environmentService.configuration.colorScheme; + } + + //#endregion + + + //#region Lifecycle + async restart(): Promise { this.reload(); } @@ -327,6 +351,8 @@ export class BrowserHostService extends Disposable implements IHostService { async reload(): Promise { window.location.reload(); } + + //#endregion } registerSingleton(IHostService, BrowserHostService, true); diff --git a/src/vs/workbench/services/host/browser/host.ts b/src/vs/workbench/services/host/browser/host.ts index 78bb77dcccb..8a0d724f07c 100644 --- a/src/vs/workbench/services/host/browser/host.ts +++ b/src/vs/workbench/services/host/browser/host.ts @@ -5,7 +5,7 @@ import { Event } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IWindowOpenable, IOpenWindowOptions, IOpenEmptyWindowOptions } from 'vs/platform/windows/common/windows'; +import { IWindowOpenable, IOpenWindowOptions, IOpenEmptyWindowOptions, ColorScheme } from 'vs/platform/windows/common/windows'; export const IHostService = createDecorator('hostService'); @@ -13,6 +13,7 @@ export interface IHostService { readonly _serviceBrand: undefined; + //#region Focus /** @@ -65,6 +66,15 @@ export interface IHostService { //#endregion + //#region Color Scheme + + readonly colorScheme: ColorScheme; + + readonly onDidChangeColorScheme: Event; + + //#endregion + + //#region Lifecycle /** diff --git a/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts b/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts index 3b633ceafd1..49ed4a1e918 100644 --- a/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts +++ b/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event } from 'vs/base/common/event'; +import { Emitter, Event } from 'vs/base/common/event'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { IElectronService } from 'vs/platform/electron/electron-sandbox/electron'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILabelService } from 'vs/platform/label/common/label'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { IWindowOpenable, IOpenWindowOptions, isFolderToOpen, isWorkspaceToOpen, IOpenEmptyWindowOptions } from 'vs/platform/windows/common/windows'; +import { IWindowOpenable, IOpenWindowOptions, isFolderToOpen, isWorkspaceToOpen, IOpenEmptyWindowOptions, ColorScheme } from 'vs/platform/windows/common/windows'; import { Disposable } from 'vs/base/common/lifecycle'; export class NativeHostService extends Disposable implements IHostService { @@ -22,8 +22,23 @@ export class NativeHostService extends Disposable implements IHostService { @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService ) { super(); + + this.registerListeners(); } + private registerListeners(): void { + + // Color Scheme + this._register(this.electronService.onColorSchemeChange(scheme => { + this._colorScheme = scheme; + + this._onDidChangeColorScheme.fire(); + })); + } + + + //#region Focus + get onDidChangeFocus(): Event { return this._onDidChangeFocus; } private _onDidChangeFocus: Event = Event.latch(Event.any( Event.map(Event.filter(this.electronService.onWindowFocus, id => id === this.electronService.windowId), () => this.hasFocus), @@ -44,6 +59,11 @@ export class NativeHostService extends Disposable implements IHostService { return activeWindowId === this.electronService.windowId; } + //#endregion + + + //#region Window + openWindow(options?: IOpenEmptyWindowOptions): Promise; openWindow(toOpen: IWindowOpenable[], options?: IOpenWindowOptions): Promise; openWindow(arg1?: IOpenEmptyWindowOptions | IWindowOpenable[], arg2?: IOpenWindowOptions): Promise { @@ -82,6 +102,22 @@ export class NativeHostService extends Disposable implements IHostService { return this.electronService.toggleFullScreen(); } + //#endregion + + + //#region Color Scheme + + private readonly _onDidChangeColorScheme = this._register(new Emitter()); + readonly onDidChangeColorScheme = this._onDidChangeColorScheme.event; + + private _colorScheme: ColorScheme = this.environmentService.configuration.colorScheme; + get colorScheme() { return this._colorScheme; } + + //#endregion + + + //#region Lifecycle + focus(options?: { force: boolean }): Promise { return this.electronService.focusWindow(options); } @@ -93,6 +129,8 @@ export class NativeHostService extends Disposable implements IHostService { reload(): Promise { return this.electronService.reload(); } + + //#endregion } registerSingleton(IHostService, NativeHostService, true); diff --git a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts index cdb52ba9224..ff15ab584c5 100644 --- a/src/vs/workbench/services/themes/browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/browser/workbenchThemeService.ts @@ -34,6 +34,7 @@ import { ProductIconThemeData, DEFAULT_PRODUCT_ICON_THEME_ID } from 'vs/workbenc import { registerProductIconThemeSchemas } from 'vs/workbench/services/themes/common/productIconThemeSchema'; import { ILogService } from 'vs/platform/log/common/log'; import { isWeb } from 'vs/base/common/platform'; +import { ColorScheme } from 'vs/platform/windows/common/windows'; // implementation @@ -108,7 +109,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { this.container = layoutService.container; this.settings = new ThemeConfiguration(configurationService); - this.isOSInHighContrast = !!environmentService.configuration.highContrast; + this.isOSInHighContrast = environmentService.configuration.colorScheme === ColorScheme.HIGH_CONTRAST; this.colorThemeRegistry = new ThemeRegistry(extensionService, colorThemesExtPoint, ColorThemeData.fromExtensionTheme); this.colorThemeWatcher = new ThemeFileWatcher(fileService, environmentService, this.reloadCurrentColorTheme.bind(this)); diff --git a/src/vs/workbench/test/browser/workbenchTestServices.ts b/src/vs/workbench/test/browser/workbenchTestServices.ts index ed24e6a26cc..a4de2b11a68 100644 --- a/src/vs/workbench/test/browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/browser/workbenchTestServices.ts @@ -32,7 +32,7 @@ import { IModeService } from 'vs/editor/common/services/modeService'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { IInstantiationService, ServicesAccessor, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { MenuBarVisibility, IWindowOpenable, IOpenWindowOptions, IOpenEmptyWindowOptions } from 'vs/platform/windows/common/windows'; +import { MenuBarVisibility, IWindowOpenable, IOpenWindowOptions, IOpenEmptyWindowOptions, ColorScheme } from 'vs/platform/windows/common/windows'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IThemeService } from 'vs/platform/theme/common/themeService'; @@ -1037,6 +1037,9 @@ export class TestHostService implements IHostService { async openWindow(arg1?: IOpenEmptyWindowOptions | IWindowOpenable[], arg2?: IOpenWindowOptions): Promise { } async toggleFullScreen(): Promise { } + + readonly colorScheme = ColorScheme.DEFAULT; + onDidChangeColorScheme = Event.None; } export class TestFilesConfigurationService extends FilesConfigurationService { diff --git a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts index 8eb9b107477..c536d51d6f1 100644 --- a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts @@ -25,7 +25,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService import { URI } from 'vs/base/common/uri'; import { IReadTextFileOptions, ITextFileStreamContent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { createTextBufferFactoryFromStream } from 'vs/editor/common/model/textModel'; -import { IOpenEmptyWindowOptions, IWindowOpenable, IOpenWindowOptions, IOpenedWindow } from 'vs/platform/windows/common/windows'; +import { IOpenEmptyWindowOptions, IWindowOpenable, IOpenWindowOptions, IOpenedWindow, ColorScheme } from 'vs/platform/windows/common/windows'; import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv'; import { LogLevel, ILogService } from 'vs/platform/log/common/log'; import { IPathService } from 'vs/workbench/services/path/common/pathService'; @@ -53,6 +53,7 @@ export const TestWorkbenchConfiguration: INativeWorkbenchConfiguration = { userEnv: {}, execPath: process.execPath, perfEntries: [], + colorScheme: ColorScheme.DEFAULT, ...parseArgs(process.argv, OPTIONS) }; @@ -165,6 +166,7 @@ export class TestElectronService implements IElectronService { onWindowFocus: Event = Event.None; onWindowBlur: Event = Event.None; onOSResume: Event = Event.None; + onColorSchemeChange = Event.None; windowCount = Promise.resolve(1); getWindowCount(): Promise { return this.windowCount; }