Comparing version 5.3.0-beta.68 to 5.3.0-beta.69
{ | ||
"name": "xterm", | ||
"description": "Full xterm terminal, in your browser", | ||
"version": "5.3.0-beta.68", | ||
"version": "5.3.0-beta.69", | ||
"main": "lib/xterm.js", | ||
@@ -6,0 +6,0 @@ "style": "css/xterm.css", |
@@ -13,3 +13,3 @@ /** | ||
import { EventEmitter } from 'common/EventEmitter'; | ||
import { Disposable } from 'common/Lifecycle'; | ||
import { Disposable, MutableDisposable } from 'common/Lifecycle'; | ||
import { DebouncedIdleTask } from 'common/TaskQueue'; | ||
@@ -27,3 +27,3 @@ import { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services'; | ||
private _renderer: IRenderer | undefined; | ||
private _renderer: MutableDisposable<IRenderer> = this.register(new MutableDisposable()); | ||
private _renderDebouncer: IRenderDebouncerWithCallback; | ||
@@ -54,3 +54,3 @@ private _screenDprMonitor: ScreenDprMonitor; | ||
public get dimensions(): IRenderDimensions { return this._renderer!.dimensions; } | ||
public get dimensions(): IRenderDimensions { return this._renderer.value!.dimensions; } | ||
@@ -69,4 +69,2 @@ constructor( | ||
this.register({ dispose: () => this._renderer?.dispose() }); | ||
this._renderDebouncer = new RenderDebouncer(coreBrowserService.window, (start, end) => this._renderRows(start, end)); | ||
@@ -80,3 +78,3 @@ this.register(this._renderDebouncer); | ||
this.register(bufferService.onResize(() => this._fullRefresh())); | ||
this.register(bufferService.buffers.onBufferActivate(() => this._renderer?.clear())); | ||
this.register(bufferService.buffers.onBufferActivate(() => this._renderer.value?.clear())); | ||
this.register(optionsService.onOptionChange(() => this._handleOptionsChanged())); | ||
@@ -156,3 +154,3 @@ this.register(this._charSizeService.onCharSizeChange(() => this.handleCharSizeChanged())); | ||
private _renderRows(start: number, end: number): void { | ||
if (!this._renderer) { | ||
if (!this._renderer.value) { | ||
return; | ||
@@ -168,7 +166,7 @@ } | ||
// Render | ||
this._renderer.renderRows(start, end); | ||
this._renderer.value.renderRows(start, end); | ||
// Update selection if needed | ||
if (this._needsSelectionRefresh) { | ||
this._renderer.handleSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode); | ||
this._renderer.value.handleSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode); | ||
this._needsSelectionRefresh = false; | ||
@@ -191,3 +189,3 @@ } | ||
private _handleOptionsChanged(): void { | ||
if (!this._renderer) { | ||
if (!this._renderer.value) { | ||
return; | ||
@@ -200,21 +198,19 @@ } | ||
private _fireOnCanvasResize(): void { | ||
if (!this._renderer) { | ||
if (!this._renderer.value) { | ||
return; | ||
} | ||
// Don't fire the event if the dimensions haven't changed | ||
if (this._renderer.dimensions.css.canvas.width === this._canvasWidth && this._renderer.dimensions.css.canvas.height === this._canvasHeight) { | ||
if (this._renderer.value.dimensions.css.canvas.width === this._canvasWidth && this._renderer.value.dimensions.css.canvas.height === this._canvasHeight) { | ||
return; | ||
} | ||
this._onDimensionsChange.fire(this._renderer.dimensions); | ||
this._onDimensionsChange.fire(this._renderer.value.dimensions); | ||
} | ||
public hasRenderer(): boolean { | ||
return !!this._renderer; | ||
return !!this._renderer.value; | ||
} | ||
public setRenderer(renderer: IRenderer): void { | ||
// TODO: RenderService should be the only one to dispose the renderer | ||
this._renderer?.dispose(); | ||
this._renderer = renderer; | ||
this._renderer.onRequestRedraw(e => this.refreshRows(e.start, e.end, true)); | ||
this._renderer.value = renderer; | ||
this._renderer.value.onRequestRedraw(e => this.refreshRows(e.start, e.end, true)); | ||
@@ -239,6 +235,6 @@ // Force a refresh | ||
public clearTextureAtlas(): void { | ||
if (!this._renderer) { | ||
if (!this._renderer.value) { | ||
return; | ||
} | ||
this._renderer.clearTextureAtlas?.(); | ||
this._renderer.value.clearTextureAtlas?.(); | ||
this._fullRefresh(); | ||
@@ -252,6 +248,6 @@ } | ||
if (!this._renderer) { | ||
if (!this._renderer.value) { | ||
return; | ||
} | ||
this._renderer.handleDevicePixelRatioChange(); | ||
this._renderer.value.handleDevicePixelRatioChange(); | ||
this.refreshRows(0, this._rowCount - 1); | ||
@@ -261,9 +257,9 @@ } | ||
public handleResize(cols: number, rows: number): void { | ||
if (!this._renderer) { | ||
if (!this._renderer.value) { | ||
return; | ||
} | ||
if (this._isPaused) { | ||
this._pausedResizeTask.set(() => this._renderer!.handleResize(cols, rows)); | ||
this._pausedResizeTask.set(() => this._renderer.value!.handleResize(cols, rows)); | ||
} else { | ||
this._renderer.handleResize(cols, rows); | ||
this._renderer.value.handleResize(cols, rows); | ||
} | ||
@@ -275,11 +271,11 @@ this._fullRefresh(); | ||
public handleCharSizeChanged(): void { | ||
this._renderer?.handleCharSizeChanged(); | ||
this._renderer.value?.handleCharSizeChanged(); | ||
} | ||
public handleBlur(): void { | ||
this._renderer?.handleBlur(); | ||
this._renderer.value?.handleBlur(); | ||
} | ||
public handleFocus(): void { | ||
this._renderer?.handleFocus(); | ||
this._renderer.value?.handleFocus(); | ||
} | ||
@@ -291,12 +287,12 @@ | ||
this._selectionState.columnSelectMode = columnSelectMode; | ||
this._renderer?.handleSelectionChanged(start, end, columnSelectMode); | ||
this._renderer.value?.handleSelectionChanged(start, end, columnSelectMode); | ||
} | ||
public handleCursorMove(): void { | ||
this._renderer?.handleCursorMove(); | ||
this._renderer.value?.handleCursorMove(); | ||
} | ||
public clear(): void { | ||
this._renderer?.clear(); | ||
this._renderer.value?.clear(); | ||
} | ||
} |
@@ -47,3 +47,3 @@ /** | ||
import { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter'; | ||
import { toDisposable } from 'common/Lifecycle'; | ||
import { MutableDisposable, toDisposable } from 'common/Lifecycle'; | ||
import * as Browser from 'common/Platform'; | ||
@@ -122,3 +122,3 @@ import { ColorRequestType, CoreMouseAction, CoreMouseButton, CoreMouseEventType, IColorEvent, ITerminalOptions, KeyboardResultType, ScrollSource, SpecialColorIndex } from 'common/Types'; | ||
private _compositionHelper: ICompositionHelper | undefined; | ||
private _accessibilityManager: AccessibilityManager | undefined; | ||
private _accessibilityManager: MutableDisposable<AccessibilityManager> = this.register(new MutableDisposable()); | ||
@@ -257,8 +257,7 @@ private readonly _onCursorMove = this.register(new EventEmitter<void>()); | ||
if (value) { | ||
if (!this._accessibilityManager && this._renderService) { | ||
this._accessibilityManager = this._instantiationService.createInstance(AccessibilityManager, this); | ||
if (!this._accessibilityManager.value && this._renderService) { | ||
this._accessibilityManager.value = this._instantiationService.createInstance(AccessibilityManager, this); | ||
} | ||
} else { | ||
this._accessibilityManager?.dispose(); | ||
this._accessibilityManager = undefined; | ||
this._accessibilityManager.clear(); | ||
} | ||
@@ -541,3 +540,3 @@ } | ||
// ensure the correct order of the dprchange event | ||
this._accessibilityManager = this._instantiationService.createInstance(AccessibilityManager, this); | ||
this._accessibilityManager.value = this._instantiationService.createInstance(AccessibilityManager, this); | ||
} | ||
@@ -544,0 +543,0 @@ this.register(this.optionsService.onSpecificOptionChange('screenReaderMode', e => this._handleScreenReaderModeOptionChange(e))); |
@@ -24,3 +24,3 @@ /** | ||
import { Disposable, toDisposable } from 'common/Lifecycle'; | ||
import { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle'; | ||
import { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, ICoreMouseService, IUnicodeService, LogLevelEnum, ITerminalOptions, IOscLinkService } from 'common/services/Services'; | ||
@@ -61,3 +61,3 @@ import { InstantiationService } from 'common/services/InstantiationService'; | ||
private _writeBuffer: WriteBuffer; | ||
private _windowsWrappingHeuristics: IDisposable | undefined; | ||
private _windowsWrappingHeuristics = this.register(new MutableDisposable()); | ||
@@ -149,7 +149,2 @@ private readonly _onBinary = this.register(new EventEmitter<string>()); | ||
this.register(forwardEvent(this._writeBuffer.onWriteParsed, this._onWriteParsed)); | ||
this.register(toDisposable(() => { | ||
this._windowsWrappingHeuristics?.dispose(); | ||
this._windowsWrappingHeuristics = undefined; | ||
})); | ||
} | ||
@@ -273,4 +268,3 @@ | ||
} else { | ||
this._windowsWrappingHeuristics?.dispose(); | ||
this._windowsWrappingHeuristics = undefined; | ||
this._windowsWrappingHeuristics.clear(); | ||
} | ||
@@ -280,3 +274,3 @@ } | ||
protected _enableWindowsWrappingHeuristics(): void { | ||
if (!this._windowsWrappingHeuristics) { | ||
if (!this._windowsWrappingHeuristics.value) { | ||
const disposables: IDisposable[] = []; | ||
@@ -288,3 +282,3 @@ disposables.push(this.onLineFeed(updateWindowsModeWrappedState.bind(null, this._bufferService))); | ||
})); | ||
this._windowsWrappingHeuristics = toDisposable(() => { | ||
this._windowsWrappingHeuristics.value = toDisposable(() => { | ||
for (const d of disposables) { | ||
@@ -291,0 +285,0 @@ d.dispose(); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2343641
24436