@@ -48,6 +48,7 @@ const DEFAULT_COLOR_THEME_ID = 'vs-dark vscode-theme-defaults-themes-dark_plus-j
48
48
const DEFAULT_LIGHT_COLOR_THEME_ID = 'vs vscode-theme-defaults-themes-light_plus-json' ;
49
49
50
50
const PERSISTED_OS_COLOR_SCHEME = 'osColorScheme' ;
51
+ const PERSISTED_OS_COLOR_SCHEME_SCOPE = StorageScope . APPLICATION ; // the OS scheme depends on settings in the OS
51
52
52
53
const defaultThemeExtensionId = 'vscode-theme-defaults' ;
53
54
@@ -151,7 +152,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
151
152
// the preferred color scheme (high contrast, light, dark) has changed since the last start
152
153
const preferredColorScheme = this . getPreferredColorScheme ( ) ;
153
154
154
- if ( preferredColorScheme && themeData ?. type !== preferredColorScheme && this . storageService . get ( PERSISTED_OS_COLOR_SCHEME , StorageScope . PROFILE ) !== preferredColorScheme ) {
155
+ if ( preferredColorScheme && themeData ?. type !== preferredColorScheme && this . storageService . get ( PERSISTED_OS_COLOR_SCHEME , PERSISTED_OS_COLOR_SCHEME_SCOPE ) !== preferredColorScheme ) {
155
156
themeData = ColorThemeData . createUnloadedThemeForThemeType ( preferredColorScheme ) ;
156
157
}
157
158
if ( ! themeData ) {
@@ -209,9 +210,9 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
209
210
const theme = this . colorThemeRegistry . findThemeBySettingsId ( this . settings . colorTheme , fallbackTheme ) ;
210
211
211
212
const preferredColorScheme = this . getPreferredColorScheme ( ) ;
212
- const prevScheme = this . storageService . get ( PERSISTED_OS_COLOR_SCHEME , StorageScope . PROFILE ) ;
213
+ const prevScheme = this . storageService . get ( PERSISTED_OS_COLOR_SCHEME , PERSISTED_OS_COLOR_SCHEME_SCOPE ) ;
213
214
if ( preferredColorScheme !== prevScheme ) {
214
- this . storageService . store ( PERSISTED_OS_COLOR_SCHEME , preferredColorScheme , StorageScope . PROFILE , StorageTarget . USER ) ;
215
+ this . storageService . store ( PERSISTED_OS_COLOR_SCHEME , preferredColorScheme , PERSISTED_OS_COLOR_SCHEME_SCOPE , StorageTarget . USER ) ;
215
216
if ( preferredColorScheme && theme ?. type !== preferredColorScheme ) {
216
217
return this . applyPreferredColorTheme ( preferredColorScheme ) ;
217
218
}
@@ -372,9 +373,9 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
372
373
373
374
private async handlePreferredSchemeUpdated ( ) {
374
375
const scheme = this . getPreferredColorScheme ( ) ;
375
- const prevScheme = this . storageService . get ( PERSISTED_OS_COLOR_SCHEME , StorageScope . PROFILE ) ;
376
+ const prevScheme = this . storageService . get ( PERSISTED_OS_COLOR_SCHEME , PERSISTED_OS_COLOR_SCHEME_SCOPE ) ;
376
377
if ( scheme !== prevScheme ) {
377
- this . storageService . store ( PERSISTED_OS_COLOR_SCHEME , scheme , StorageScope . PROFILE , StorageTarget . MACHINE ) ;
378
+ this . storageService . store ( PERSISTED_OS_COLOR_SCHEME , scheme , PERSISTED_OS_COLOR_SCHEME_SCOPE , StorageTarget . MACHINE ) ;
378
379
if ( scheme ) {
379
380
if ( ! prevScheme ) {
380
381
// remember the theme before scheme switching
0 commit comments