mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 09:18:59 +00:00
parent
21c66842b7
commit
97df4dad38
|
@ -52,8 +52,7 @@
|
|||
"treeViewActiveItem",
|
||||
"treeViewReveal",
|
||||
"workspaceTrust",
|
||||
"telemetry",
|
||||
"windowActivity"
|
||||
"telemetry"
|
||||
],
|
||||
"private": true,
|
||||
"activationEvents": [],
|
||||
|
|
|
@ -749,7 +749,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
|||
return _asExtensionEvent(extHostTerminalShellIntegration.onDidEndTerminalShellExecution)(listener, thisArg, disposables);
|
||||
},
|
||||
get state() {
|
||||
return extHostWindow.getState(extension);
|
||||
return extHostWindow.getState();
|
||||
},
|
||||
onDidChangeWindowState(listener, thisArg?, disposables?) {
|
||||
return _asExtensionEvent(extHostWindow.onDidChangeWindowState)(listener, thisArg, disposables);
|
||||
|
|
|
@ -3,16 +3,14 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { ExtHostWindowShape, MainContext, MainThreadWindowShape, IOpenUriOptions } from './extHost.protocol';
|
||||
import { WindowState } from 'vscode';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { isFalsyOrWhitespace } from 'vs/base/common/strings';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
|
||||
import { IRelaxedExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { WindowState } from 'vscode';
|
||||
import { ExtHostWindowShape, IOpenUriOptions, MainContext, MainThreadWindowShape } from './extHost.protocol';
|
||||
|
||||
export class ExtHostWindow implements ExtHostWindowShape {
|
||||
|
||||
|
@ -28,7 +26,7 @@ export class ExtHostWindow implements ExtHostWindowShape {
|
|||
|
||||
private _state = ExtHostWindow.InitialState;
|
||||
|
||||
getState(extension: Readonly<IRelaxedExtensionDescription>): WindowState {
|
||||
getState(): WindowState {
|
||||
// todo@connor4312: this can be changed to just return this._state after proposed api is finalized
|
||||
const state = this._state;
|
||||
|
||||
|
@ -37,7 +35,6 @@ export class ExtHostWindow implements ExtHostWindowShape {
|
|||
return state.focused;
|
||||
},
|
||||
get active() {
|
||||
checkProposedApiEnabled(extension, 'windowActivity');
|
||||
return state.active;
|
||||
},
|
||||
};
|
||||
|
|
|
@ -122,7 +122,6 @@ export const allApiProposals = Object.freeze({
|
|||
treeViewReveal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts',
|
||||
tunnelFactory: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts',
|
||||
tunnels: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts',
|
||||
windowActivity: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.windowActivity.d.ts',
|
||||
workspaceTrust: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts'
|
||||
});
|
||||
export type ApiProposalName = keyof typeof allApiProposals;
|
||||
|
|
6
src/vscode-dts/vscode.d.ts
vendored
6
src/vscode-dts/vscode.d.ts
vendored
|
@ -10299,6 +10299,12 @@ declare module 'vscode' {
|
|||
* Whether the current window is focused.
|
||||
*/
|
||||
readonly focused: boolean;
|
||||
|
||||
/**
|
||||
* Whether the window has been interacted with recently. This will change
|
||||
* immediately on activity, or after a short time of user inactivity.
|
||||
*/
|
||||
readonly active: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'vscode' {
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/181569 @connor4312
|
||||
|
||||
export interface WindowState {
|
||||
/**
|
||||
* Indicates whether the window has been interacted with recently. This will
|
||||
* change immediately on activity, or after a short time of user inactivity.
|
||||
*/
|
||||
readonly active: boolean;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue