ipc - have an explicit method to mark a window ready

This commit is contained in:
Benjamin Pasero
2020-06-15 17:56:18 +02:00
parent bc9c87a80d
commit f22dcae3b7
7 changed files with 29 additions and 29 deletions

View File

@@ -91,15 +91,18 @@ export class CodeWindow extends Disposable implements ICodeWindow {
private static readonly MAX_URL_LENGTH = 2 * 1024 * 1024; // https://cs.chromium.org/chromium/src/url/url_constants.cc?l=32
private readonly _onLoad = this._register(new Emitter<void>());
readonly onLoad = this._onLoad.event;
private readonly _onReady = this._register(new Emitter<void>());
readonly onReady = this._onReady.event;
private readonly _onClose = this._register(new Emitter<void>());
readonly onClose = this._onClose.event;
private readonly _onDestroy = this._register(new Emitter<void>());
readonly onDestroy = this._onDestroy.event;
private readonly _onLoad = this._register(new Emitter<void>());
readonly onLoad = this._onLoad.event;
private hiddenTitleBarStyle: boolean | undefined;
private showTimeoutHandle: NodeJS.Timeout | undefined;
private _lastFocusTime: number;
@@ -346,6 +349,9 @@ export class CodeWindow extends Disposable implements ICodeWindow {
while (this.whenReadyCallbacks.length) {
this.whenReadyCallbacks.pop()!(this);
}
// Events
this._onReady.fire();
}
ready(): Promise<ICodeWindow> {