mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 20:43:31 +01:00
We compile using the alwaysStrict flag so these directives are not needed This part removes most `use strict` directives that are right after the file header
36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { IWindowService } from 'vs/platform/windows/common/windows';
|
|
import { MainThreadWindowShape, ExtHostWindowShape, ExtHostContext, MainContext, IExtHostContext } from '../node/extHost.protocol';
|
|
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
|
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
|
|
import { latch } from 'vs/base/common/event';
|
|
|
|
@extHostNamedCustomer(MainContext.MainThreadWindow)
|
|
export class MainThreadWindow implements MainThreadWindowShape {
|
|
|
|
private readonly proxy: ExtHostWindowShape;
|
|
private disposables: IDisposable[] = [];
|
|
|
|
constructor(
|
|
extHostContext: IExtHostContext,
|
|
@IWindowService private windowService: IWindowService
|
|
) {
|
|
this.proxy = extHostContext.getProxy(ExtHostContext.ExtHostWindow);
|
|
|
|
latch(windowService.onDidChangeFocus)
|
|
(this.proxy.$onDidChangeWindowFocus, this.proxy, this.disposables);
|
|
}
|
|
|
|
$getWindowVisibility(): Thenable<boolean> {
|
|
return this.windowService.isFocused();
|
|
}
|
|
|
|
dispose(): void {
|
|
this.disposables = dispose(this.disposables);
|
|
}
|
|
}
|