@@ -299,6 +299,11 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
299
299
300
300
// Window focus changes
301
301
this . _register ( this . hostService . onDidChangeFocus ( e => this . onWindowFocusChanged ( e ) ) ) ;
302
+
303
+ // WCO changes
304
+ if ( isWeb && typeof ( navigator as any ) . windowControlsOverlay === 'object' ) {
305
+ this . _register ( addDisposableListener ( ( navigator as any ) . windowControlsOverlay , 'geometrychange' , ( ) => this . onDidChangeWCO ( ) ) ) ;
306
+ }
302
307
}
303
308
304
309
private onMenubarToggled ( visible : boolean ) : void {
@@ -1104,6 +1109,10 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
1104
1109
}
1105
1110
}
1106
1111
1112
+ private shouldShowBannerFirst ( ) : boolean {
1113
+ return isWeb && ! isWCOVisible ( ) ;
1114
+ }
1115
+
1107
1116
focus ( ) : void {
1108
1117
this . focusPart ( Parts . EDITOR_PART ) ;
1109
1118
}
@@ -2008,6 +2017,17 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
2008
2017
return undefined ;
2009
2018
}
2010
2019
2020
+ private onDidChangeWCO ( ) : void {
2021
+ const bannerFirst = this . workbenchGrid . getNeighborViews ( this . titleBarPartView , Direction . Up , false ) . length > 0 ;
2022
+ const shouldBannerBeFirst = this . shouldShowBannerFirst ( ) ;
2023
+
2024
+ if ( bannerFirst !== shouldBannerBeFirst ) {
2025
+ this . workbenchGrid . moveView ( this . bannerPartView , Sizing . Distribute , this . titleBarPartView , shouldBannerBeFirst ? Direction . Up : Direction . Down ) ;
2026
+ }
2027
+
2028
+ this . workbenchGrid . setViewVisible ( this . titleBarPartView , this . shouldShowTitleBar ( ) ) ;
2029
+ }
2030
+
2011
2031
private arrangeEditorNodes ( nodes : { editor : ISerializedNode ; sideBar ?: ISerializedNode ; auxiliaryBar ?: ISerializedNode } , availableHeight : number , availableWidth : number ) : ISerializedNode {
2012
2032
if ( ! nodes . sideBar && ! nodes . auxiliaryBar ) {
2013
2033
nodes . editor . size = availableHeight ;
@@ -2187,7 +2207,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
2187
2207
type : 'branch' ,
2188
2208
size : width ,
2189
2209
data : [
2190
- ...( isWeb ? titleAndBanner . reverse ( ) : titleAndBanner ) ,
2210
+ ...( this . shouldShowBannerFirst ( ) ? titleAndBanner . reverse ( ) : titleAndBanner ) ,
2191
2211
{
2192
2212
type : 'branch' ,
2193
2213
data : middleSection ,
0 commit comments