Skip to content

Commit 83b909c

Browse files
committed
aux window - ensure focus window before showing editor close confirmation
1 parent ce283e0 commit 83b909c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vs/workbench/browser/parts/editor/editorGroupView.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { EditorGroupWatermark } from 'vs/workbench/browser/parts/editor/editorGr
5555
import { EditorTitleControl } from 'vs/workbench/browser/parts/editor/editorTitleControl';
5656
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
5757
import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService';
58+
import { IHostService } from 'vs/workbench/services/host/browser/host';
5859

5960
export class EditorGroupView extends Themable implements IEditorGroupView {
6061

@@ -154,7 +155,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
154155
@IFilesConfigurationService private readonly filesConfigurationService: IFilesConfigurationService,
155156
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
156157
@ILogService private readonly logService: ILogService,
157-
@IEditorResolverService private readonly editorResolverService: IEditorResolverService
158+
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
159+
@IHostService private readonly hostService: IHostService
158160
) {
159161
super(themeService);
160162

@@ -1605,6 +1607,9 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
16051607
await this.doOpenEditor(editor);
16061608
}
16071609

1610+
// Ensure our window has focus since we are about to show a dialog
1611+
await this.hostService.focus(getWindow(this.element));
1612+
16081613
// Let editor handle confirmation if implemented
16091614
if (typeof editor.closeHandler?.confirm === 'function') {
16101615
confirmation = await editor.closeHandler.confirm([{ editor, groupId: this.id }]);

0 commit comments

Comments
 (0)