mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-15 17:09:59 +00:00
only configure tabs if they're focused (fixes #659)
This commit is contained in:
parent
3039a65757
commit
e338bc417a
@ -1,4 +1,4 @@
|
|||||||
import { Observable, Subject, Subscription } from 'rxjs'
|
import { Observable, Subject, Subscription, merge } from 'rxjs'
|
||||||
import { first } from 'rxjs/operators'
|
import { first } from 'rxjs/operators'
|
||||||
import { ToastrService } from 'ngx-toastr'
|
import { ToastrService } from 'ngx-toastr'
|
||||||
import { NgZone, OnInit, OnDestroy, Inject, Injector, Optional, ViewChild, HostBinding, Input, ElementRef } from '@angular/core'
|
import { NgZone, OnInit, OnDestroy, Inject, Injector, Optional, ViewChild, HostBinding, Input, ElementRef } from '@angular/core'
|
||||||
@ -200,6 +200,13 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
|
|
||||||
attachTermContainerHandlers () {
|
attachTermContainerHandlers () {
|
||||||
this.detachTermContainerHandlers()
|
this.detachTermContainerHandlers()
|
||||||
|
|
||||||
|
const maybeConfigure = () => {
|
||||||
|
if (this.hasFocus) {
|
||||||
|
setTimeout(() => this.configure(), 250)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.termContainerSubscriptions = [
|
this.termContainerSubscriptions = [
|
||||||
this.frontend.title$.subscribe(title => this.zone.run(() => this.setTitle(title))),
|
this.frontend.title$.subscribe(title => this.zone.run(() => this.setTitle(title))),
|
||||||
|
|
||||||
@ -262,13 +269,8 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|
||||||
this.hostApp.windowMoved$.subscribe(() => setTimeout(() => {
|
this.hostApp.displayMetricsChanged$.subscribe(maybeConfigure),
|
||||||
this.configure()
|
this.hostApp.windowMoved$.subscribe(maybeConfigure),
|
||||||
}, 250)),
|
|
||||||
|
|
||||||
this.hostApp.displayMetricsChanged$.subscribe(() => setTimeout(() => {
|
|
||||||
this.configure()
|
|
||||||
}, 250)),
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user