@@ -55,6 +55,7 @@ import { EditorGroupWatermark } from 'vs/workbench/browser/parts/editor/editorGr
55
55
import { EditorTitleControl } from 'vs/workbench/browser/parts/editor/editorTitleControl' ;
56
56
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane' ;
57
57
import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService' ;
58
+ import { IHostService } from 'vs/workbench/services/host/browser/host' ;
58
59
59
60
export class EditorGroupView extends Themable implements IEditorGroupView {
60
61
@@ -154,7 +155,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
154
155
@IFilesConfigurationService private readonly filesConfigurationService : IFilesConfigurationService ,
155
156
@IUriIdentityService private readonly uriIdentityService : IUriIdentityService ,
156
157
@ILogService private readonly logService : ILogService ,
157
- @IEditorResolverService private readonly editorResolverService : IEditorResolverService
158
+ @IEditorResolverService private readonly editorResolverService : IEditorResolverService ,
159
+ @IHostService private readonly hostService : IHostService
158
160
) {
159
161
super ( themeService ) ;
160
162
@@ -1605,6 +1607,9 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
1605
1607
await this . doOpenEditor ( editor ) ;
1606
1608
}
1607
1609
1610
+ // Ensure our window has focus since we are about to show a dialog
1611
+ await this . hostService . focus ( getWindow ( this . element ) ) ;
1612
+
1608
1613
// Let editor handle confirmation if implemented
1609
1614
if ( typeof editor . closeHandler ?. confirm === 'function' ) {
1610
1615
confirmation = await editor . closeHandler . confirm ( [ { editor, groupId : this . id } ] ) ;
0 commit comments