@@ -28,6 +28,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
2828import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
2929import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
3030import { IMenuService } from 'vs/platform/actions/common/actions' ;
31+ import { IWindowService } from 'vs/platform/windows/common/windows' ;
3132import { TitleControl } from 'vs/workbench/browser/parts/editor/titleControl' ;
3233import { IQuickOpenService } from 'vs/workbench/services/quickopen/common/quickOpenService' ;
3334import { IDisposable , dispose } from 'vs/base/common/lifecycle' ;
@@ -65,7 +66,8 @@ export class TabsTitleControl extends TitleControl {
6566 @ITelemetryService telemetryService : ITelemetryService ,
6667 @IMessageService messageService : IMessageService ,
6768 @IMenuService menuService : IMenuService ,
68- @IQuickOpenService quickOpenService : IQuickOpenService
69+ @IQuickOpenService quickOpenService : IQuickOpenService ,
70+ @IWindowService private windowService : IWindowService
6971 ) {
7072 super ( contextMenuService , instantiationService , configurationService , editorService , editorGroupService , contextKeyService , keybindingService , telemetryService , messageService , menuService , quickOpenService ) ;
7173
@@ -582,10 +584,10 @@ export class TabsTitleControl extends TitleControl {
582584 input : { resource, options : { pinned : true , index : targetIndex } } ,
583585 position : targetPosition
584586 } ;
585- } ) ) . done ( ( ) => {
587+ } ) ) . then ( ( ) => {
586588 this . editorGroupService . focusGroup ( targetPosition ) ;
587- window . focus ( ) ;
588- } , errors . onUnexpectedError ) ;
589+ return this . windowService . focusWindow ( ) ;
590+ } ) . done ( null , errors . onUnexpectedError ) ;
589591 }
590592 }
591593
0 commit comments