@@ -17,7 +17,8 @@ import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/b
17
17
import { ViewContainerLocation } from 'vs/workbench/common/views' ;
18
18
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
19
19
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
20
- import { mainWindow } from 'vs/base/browser/window' ;
20
+ import { getActiveWindow } from 'vs/base/browser/dom' ;
21
+ import { isAuxiliaryWindow } from 'vs/base/browser/window' ;
21
22
22
23
abstract class BaseNavigationAction extends Action2 {
23
24
@@ -254,28 +255,41 @@ abstract class BaseFocusAction extends Action2 {
254
255
}
255
256
256
257
private findVisibleNeighbour ( layoutService : IWorkbenchLayoutService , part : Parts , next : boolean ) : Parts {
258
+ const activeWindow = getActiveWindow ( ) ;
259
+ const windowIsAuxiliary = isAuxiliaryWindow ( activeWindow ) ;
260
+
257
261
let neighbour : Parts ;
258
- switch ( part ) {
259
- case Parts . EDITOR_PART :
260
- neighbour = next ? Parts . PANEL_PART : Parts . SIDEBAR_PART ;
261
- break ;
262
- case Parts . PANEL_PART :
263
- neighbour = next ? Parts . STATUSBAR_PART : Parts . EDITOR_PART ;
264
- break ;
265
- case Parts . STATUSBAR_PART :
266
- neighbour = next ? Parts . ACTIVITYBAR_PART : Parts . PANEL_PART ;
267
- break ;
268
- case Parts . ACTIVITYBAR_PART :
269
- neighbour = next ? Parts . SIDEBAR_PART : Parts . STATUSBAR_PART ;
270
- break ;
271
- case Parts . SIDEBAR_PART :
272
- neighbour = next ? Parts . EDITOR_PART : Parts . ACTIVITYBAR_PART ;
273
- break ;
274
- default :
275
- neighbour = Parts . EDITOR_PART ;
262
+ if ( windowIsAuxiliary ) {
263
+ switch ( part ) {
264
+ case Parts . EDITOR_PART :
265
+ neighbour = Parts . STATUSBAR_PART ;
266
+ break ;
267
+ default :
268
+ neighbour = Parts . EDITOR_PART ;
269
+ }
270
+ } else {
271
+ switch ( part ) {
272
+ case Parts . EDITOR_PART :
273
+ neighbour = next ? Parts . PANEL_PART : Parts . SIDEBAR_PART ;
274
+ break ;
275
+ case Parts . PANEL_PART :
276
+ neighbour = next ? Parts . STATUSBAR_PART : Parts . EDITOR_PART ;
277
+ break ;
278
+ case Parts . STATUSBAR_PART :
279
+ neighbour = next ? Parts . ACTIVITYBAR_PART : Parts . PANEL_PART ;
280
+ break ;
281
+ case Parts . ACTIVITYBAR_PART :
282
+ neighbour = next ? Parts . SIDEBAR_PART : Parts . STATUSBAR_PART ;
283
+ break ;
284
+ case Parts . SIDEBAR_PART :
285
+ neighbour = next ? Parts . EDITOR_PART : Parts . ACTIVITYBAR_PART ;
286
+ break ;
287
+ default :
288
+ neighbour = Parts . EDITOR_PART ;
289
+ }
276
290
}
277
291
278
- if ( layoutService . isVisible ( neighbour , mainWindow ) || neighbour === Parts . EDITOR_PART ) {
292
+ if ( layoutService . isVisible ( neighbour , activeWindow ) || neighbour === Parts . EDITOR_PART ) {
279
293
return neighbour ;
280
294
}
281
295
@@ -296,7 +310,7 @@ abstract class BaseFocusAction extends Action2 {
296
310
currentlyFocusedPart = Parts . PANEL_PART ;
297
311
}
298
312
299
- layoutService . focusPart ( currentlyFocusedPart ? this . findVisibleNeighbour ( layoutService , currentlyFocusedPart , next ) : Parts . EDITOR_PART , mainWindow ) ;
313
+ layoutService . focusPart ( currentlyFocusedPart ? this . findVisibleNeighbour ( layoutService , currentlyFocusedPart , next ) : Parts . EDITOR_PART , getActiveWindow ( ) ) ;
300
314
}
301
315
}
302
316
0 commit comments