提交 d6c9ce84 编写于 作者: E Eugene Pankov

delay frontend init if not focused (fixes #1147, fixes #1137)

上级 1fdf5367
......@@ -189,7 +189,11 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
this.focused$.subscribe(() => {
this.getAllTabs().forEach(x => x.emitFocused())
this.focus(this.focusedTab)
if (this.focusedTab) {
this.focus(this.focusedTab)
} else {
this.focusAnyIn(this.root)
}
})
this.blurred$.subscribe(() => this.getAllTabs().forEach(x => x.emitBlurred()))
......@@ -235,8 +239,10 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
await this.recoverContainer(this.root, this._recoveredState)
this.layout()
setImmediate(() => {
this.getAllTabs().forEach(x => x.emitFocused())
this.focusAnyIn(this.root)
if (this.hasFocus) {
this.getAllTabs().forEach(x => x.emitFocused())
this.focusAnyIn(this.root)
}
})
}
}
......
......@@ -174,15 +174,17 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
this.session.releaseInitialDataBuffer()
})
this.frontend.configure()
if (this.hasFocus) {
this.frontend.attach(this.content.nativeElement)
} else {
this.focused$.pipe(first()).subscribe(() => {
setImmediate(() => {
if (this.hasFocus) {
this.frontend.attach(this.content.nativeElement)
})
}
this.frontend.configure()
} else {
this.focused$.pipe(first()).subscribe(() => {
this.frontend.attach(this.content.nativeElement)
this.frontend.configure()
})
}
})
this.attachTermContainerHandlers()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册