@@ -12,10 +12,8 @@ import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier } from 'vs/platf
1212import { IRecentlyOpened , IRecent } from 'vs/platform/history/common/history' ;
1313import { ExportData } from 'vs/base/common/performance' ;
1414import { LogLevel } from 'vs/platform/log/common/log' ;
15- import { DisposableStore , Disposable } from 'vs/base/common/lifecycle' ;
1615import { URI , UriComponents } from 'vs/base/common/uri' ;
1716import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
18- import { CancelablePromise , createCancelablePromise } from 'vs/base/common/async' ;
1917
2018export const IWindowsService = createDecorator < IWindowsService > ( 'windowsService' ) ;
2119
@@ -44,8 +42,6 @@ export interface IWindowsService {
4442 clearRecentlyOpened ( ) : Promise < void > ;
4543 getRecentlyOpened ( windowId : number ) : Promise < IRecentlyOpened > ;
4644 isFocused ( windowId : number ) : Promise < boolean > ;
47-
48- getActiveWindowId ( ) : Promise < number | undefined > ;
4945}
5046
5147export const IWindowService = createDecorator < IWindowService > ( 'windowService' ) ;
@@ -315,37 +311,3 @@ export interface IRunActionInWindowRequest {
315311export interface IRunKeybindingInWindowRequest {
316312 userSettingsLabel : string ;
317313}
318-
319- export class ActiveWindowManager extends Disposable {
320-
321- private readonly disposables = this . _register ( new DisposableStore ( ) ) ;
322- private firstActiveWindowIdPromise : CancelablePromise < number | undefined > | undefined ;
323- private activeWindowId : number | undefined ;
324-
325- constructor ( @IWindowsService windowsService : IWindowsService ) {
326- super ( ) ;
327-
328- const onActiveWindowChange = Event . latch ( Event . any ( windowsService . onWindowOpen , windowsService . onWindowFocus ) ) ;
329- onActiveWindowChange ( this . setActiveWindow , this , this . disposables ) ;
330-
331- this . firstActiveWindowIdPromise = createCancelablePromise ( _ => windowsService . getActiveWindowId ( ) ) ;
332- this . firstActiveWindowIdPromise
333- . then ( id => this . activeWindowId = typeof this . activeWindowId === 'number' ? this . activeWindowId : id )
334- . finally ( this . firstActiveWindowIdPromise = undefined ) ;
335- }
336-
337- private setActiveWindow ( windowId : number | undefined ) {
338- if ( this . firstActiveWindowIdPromise ) {
339- this . firstActiveWindowIdPromise . cancel ( ) ;
340- this . firstActiveWindowIdPromise = undefined ;
341- }
342-
343- this . activeWindowId = windowId ;
344- }
345-
346- async getActiveClientId ( ) : Promise < string | undefined > {
347- const id = this . firstActiveWindowIdPromise ? ( await this . firstActiveWindowIdPromise ) : this . activeWindowId ;
348-
349- return `window:${ id } ` ;
350- }
351- }
0 commit comments