File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -165,16 +165,20 @@ export function getTitleBarStyle(configurationService: IConfigurationService): '
165
165
}
166
166
167
167
export function useWindowControlsOverlay ( configurationService : IConfigurationService , environmentService : IEnvironmentService ) : boolean {
168
- // Window Controls Overlay are only configurable on Windows
169
168
if ( ! isWindows || isWeb || ! environmentService . isBuilt ) {
170
- return false ;
169
+ return false ; // only supported on a built desktop windows instance
171
170
}
172
171
173
172
if ( getTitleBarStyle ( configurationService ) === 'native' ) {
174
- return false ;
173
+ return false ; // only supported when title bar is custom
175
174
}
176
175
177
- return configurationService . getValue < boolean > ( 'window.experimental.windowControlsOverlay.enabled' ) ;
176
+ const configuredUseWindowControlsOverlay = configurationService . getValue < boolean | undefined > ( 'window.experimental.windowControlsOverlay.enabled' ) ;
177
+ if ( typeof configuredUseWindowControlsOverlay === 'boolean' ) {
178
+ return configuredUseWindowControlsOverlay ;
179
+ }
180
+
181
+ return true ; // enabled by default
178
182
}
179
183
180
184
export interface IPath < T = IEditorOptions > extends IPathData < T > {
Original file line number Diff line number Diff line change @@ -143,6 +143,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
143
143
private representedFilename : string | undefined ;
144
144
private documentEdited : boolean | undefined ;
145
145
146
+ private readonly hasWindowControlOverlay : boolean = false ;
147
+
146
148
private readonly whenReadyCallbacks : { ( window : ICodeWindow ) : void } [ ] = [ ] ;
147
149
148
150
private readonly touchBarGroups : TouchBarSegmentedControl [ ] = [ ] ;
@@ -280,6 +282,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
280
282
color : titleBarColor ,
281
283
symbolColor
282
284
} ;
285
+
286
+ this . hasWindowControlOverlay = true ;
283
287
}
284
288
}
285
289
@@ -1072,7 +1076,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
1072
1076
}
1073
1077
1074
1078
// Windows: window control overlay (WCO)
1075
- if ( isWindows && useWindowControlsOverlay ( this . configurationService , this . environmentMainService ) ) {
1079
+ if ( isWindows && this . hasWindowControlOverlay ) {
1076
1080
this . _win . setTitleBarOverlay ( {
1077
1081
color : options . backgroundColor ?. trim ( ) === '' ? undefined : options . backgroundColor ,
1078
1082
symbolColor : options . foregroundColor ?. trim ( ) === '' ? undefined : options . foregroundColor ,
You can’t perform that action at this time.
0 commit comments