6
6
import { localize } from 'vs/nls' ;
7
7
import { IThemeService } from 'vs/platform/theme/common/themeService' ;
8
8
import { Part } from 'vs/workbench/browser/part' ;
9
- import { Dimension , isAncestor , $ , EventHelper , addDisposableGenericMouseDownListener } from 'vs/base/browser/dom' ;
9
+ import { Dimension , isAncestor , $ , EventHelper , addDisposableGenericMouseDownListener , getWindow } from 'vs/base/browser/dom' ;
10
10
import { Event , Emitter , Relay } from 'vs/base/common/event' ;
11
11
import { contrastBorder , editorBackground } from 'vs/platform/theme/common/colorRegistry' ;
12
12
import { GroupDirection , GroupsArrangement , GroupOrientation , IMergeGroupOptions , MergeGroupMode , GroupsOrder , GroupLocation , IFindGroupScope , EditorGroupLayout , GroupLayoutArgument , IEditorSideGroup , IEditorDropTargetDelegate , IAuxiliaryEditorPart , IEditorPart } from 'vs/workbench/services/editor/common/editorGroupsService' ;
@@ -32,6 +32,7 @@ import { DeferredPromise, Promises } from 'vs/base/common/async';
32
32
import { findGroup } from 'vs/workbench/services/editor/common/editorGroupFinder' ;
33
33
import { SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService' ;
34
34
import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash' ;
35
+ import { IHostService } from 'vs/workbench/services/host/browser/host' ;
35
36
36
37
interface IEditorPartUIState {
37
38
readonly serializedGrid : ISerializedGrid ;
@@ -152,6 +153,7 @@ export class EditorPart extends Part implements IEditorPart {
152
153
@IConfigurationService private readonly configurationService : IConfigurationService ,
153
154
@IStorageService storageService : IStorageService ,
154
155
@IWorkbenchLayoutService layoutService : IWorkbenchLayoutService ,
156
+ @IHostService private readonly hostService : IHostService
155
157
) {
156
158
super ( id , { hasTitle : false } , themeService , storageService , layoutService ) ;
157
159
@@ -660,6 +662,10 @@ export class EditorPart extends Part implements IEditorPart {
660
662
}
661
663
662
664
private doSetGroupActive ( group : IEditorGroupView ) : void {
665
+
666
+ // Ensure window on top
667
+ this . hostService . moveTop ( getWindow ( this . element ) ) ;
668
+
663
669
if ( this . _activeGroup !== group ) {
664
670
const previousActiveGroup = this . _activeGroup ;
665
671
this . _activeGroup = group ;
@@ -1315,9 +1321,10 @@ export class MainEditorPart extends EditorPart {
1315
1321
@IThemeService themeService : IThemeService ,
1316
1322
@IConfigurationService configurationService : IConfigurationService ,
1317
1323
@IStorageService storageService : IStorageService ,
1318
- @IWorkbenchLayoutService layoutService : IWorkbenchLayoutService
1324
+ @IWorkbenchLayoutService layoutService : IWorkbenchLayoutService ,
1325
+ @IHostService hostService : IHostService
1319
1326
) {
1320
- super ( editorPartsView , Parts . EDITOR_PART , '' , instantiationService , themeService , configurationService , storageService , layoutService ) ;
1327
+ super ( editorPartsView , Parts . EDITOR_PART , '' , instantiationService , themeService , configurationService , storageService , layoutService , hostService ) ;
1321
1328
}
1322
1329
}
1323
1330
@@ -1334,10 +1341,11 @@ export class AuxiliaryEditorPart extends EditorPart implements IAuxiliaryEditorP
1334
1341
@IThemeService themeService : IThemeService ,
1335
1342
@IConfigurationService configurationService : IConfigurationService ,
1336
1343
@IStorageService storageService : IStorageService ,
1337
- @IWorkbenchLayoutService layoutService : IWorkbenchLayoutService
1344
+ @IWorkbenchLayoutService layoutService : IWorkbenchLayoutService ,
1345
+ @IHostService hostService : IHostService
1338
1346
) {
1339
1347
const id = AuxiliaryEditorPart . COUNTER ++ ;
1340
- super ( editorPartsView , `workbench.parts.auxiliaryEditor.${ id } ` , localize ( 'auxiliaryEditorPartLabel' , "Window {0}" , id + 1 ) , instantiationService , themeService , configurationService , storageService , layoutService ) ;
1348
+ super ( editorPartsView , `workbench.parts.auxiliaryEditor.${ id } ` , localize ( 'auxiliaryEditorPartLabel' , "Window {0}" , id + 1 ) , instantiationService , themeService , configurationService , storageService , layoutService , hostService ) ;
1341
1349
}
1342
1350
1343
1351
protected override saveState ( ) : void {
0 commit comments