onRecoverContext -> onContextLoss

This commit is contained in:
meganrogge
2021-04-01 13:32:35 -07:00
parent 47ac4dd9fe
commit b1877b4dc7
2 changed files with 6 additions and 11 deletions
+3 -3
View File
@@ -12,8 +12,8 @@ import { EventEmitter } from 'common/EventEmitter';
export class WebglAddon implements ITerminalAddon {
private _terminal?: Terminal;
private _renderer?: WebglRenderer;
private _onRecoverContext = new EventEmitter<void>();
public get onRecoverContext(): IEvent<void> { return this._onRecoverContext.event; }
private _onContextLoss = new EventEmitter<void>();
public get onContextLoss(): IEvent<void> { return this._onContextLoss.event; }
constructor(
private _preserveDrawingBuffer?: boolean
@@ -27,7 +27,7 @@ export class WebglAddon implements ITerminalAddon {
const renderService: IRenderService = (<any>terminal)._core._renderService;
const colors: IColorSet = (<any>terminal)._core._colorManager.colors;
this._renderer = new WebglRenderer(terminal, colors, this._preserveDrawingBuffer);
this._renderer.onRecoverContext(() => this._onRecoverContext.fire());
this._renderer.onContextLoss(() => this._onContextLoss.fire());
renderService.setRenderer(this._renderer);
}