mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
perf: avoid gpu memory increase
This commit is contained in:
@@ -408,6 +408,23 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
this.blurred$.subscribe(() => {
|
||||
this.multifocus.cancel()
|
||||
})
|
||||
|
||||
this.visibility$.subscribe(visibility => {
|
||||
if (this.frontend instanceof XTermFrontend) {
|
||||
if (visibility) {
|
||||
// this.frontend.resizeHandler()
|
||||
const term = this.frontend.xterm as any
|
||||
term._core._renderService.clear()
|
||||
term._core._renderService.handleResize(term.cols, term.rows)
|
||||
} else {
|
||||
this.frontend.xterm.element?.querySelectorAll('canvas').forEach(c => {
|
||||
c.height = c.width = 0
|
||||
c.style.height = c.style.width = '0px'
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log('visibility:', this.title, visibility)
|
||||
})
|
||||
}
|
||||
|
||||
protected onFrontendReady (): void {
|
||||
|
@@ -66,7 +66,7 @@ export class XTermFrontend extends Frontend {
|
||||
private configuredFontSize = 0
|
||||
private configuredLinePadding = 0
|
||||
private zoom = 0
|
||||
private resizeHandler: () => void
|
||||
resizeHandler: () => void
|
||||
private configuredTheme: ITheme = {}
|
||||
private copyOnSelect = false
|
||||
private preventNextOnSelectionChangeEvent = false
|
||||
|
Reference in New Issue
Block a user