Skip to content

Commit

Permalink
aux window - ensure focus window before showing editor close confirma…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
bpasero committed Dec 30, 2023
1 parent ce283e0 commit 83b909c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vs/workbench/browser/parts/editor/editorGroupView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import { EditorGroupWatermark } from 'vs/workbench/browser/parts/editor/editorGr
import { EditorTitleControl } from 'vs/workbench/browser/parts/editor/editorTitleControl';
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService';
import { IHostService } from 'vs/workbench/services/host/browser/host';

export class EditorGroupView extends Themable implements IEditorGroupView {

Expand Down Expand Up @@ -154,7 +155,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
@IFilesConfigurationService private readonly filesConfigurationService: IFilesConfigurationService,
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
@ILogService private readonly logService: ILogService,
@IEditorResolverService private readonly editorResolverService: IEditorResolverService
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
@IHostService private readonly hostService: IHostService
) {
super(themeService);

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

// Ensure our window has focus since we are about to show a dialog
await this.hostService.focus(getWindow(this.element));

// Let editor handle confirmation if implemented
if (typeof editor.closeHandler?.confirm === 'function') {
confirmation = await editor.closeHandler.confirm([{ editor, groupId: this.id }]);
Expand Down

0 comments on commit 83b909c

Please sign in to comment.