mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-24 11:02:47 +03:00
fixed terminal not getting focus when switching windows (fixes #692)
This commit is contained in:
parent
b07a2113d2
commit
21cb452d62
@ -202,6 +202,10 @@ export class Window {
|
||||
}
|
||||
})
|
||||
|
||||
this.window.on('focus', () => {
|
||||
this.send('host:window-focused')
|
||||
})
|
||||
|
||||
ipcMain.on('window-focus', event => {
|
||||
if (!this.window || event.sender !== this.window.webContents) {
|
||||
return
|
||||
|
@ -83,6 +83,10 @@ export class AppService {
|
||||
this.startTabStorage()
|
||||
}
|
||||
}
|
||||
|
||||
hostApp.windowFocused$.subscribe(() => {
|
||||
this._activeTab?.emitFocused()
|
||||
})
|
||||
}
|
||||
|
||||
startTabStorage () {
|
||||
|
@ -39,6 +39,7 @@ export class HostAppService {
|
||||
private configChangeBroadcast = new Subject<void>()
|
||||
private windowCloseRequest = new Subject<void>()
|
||||
private windowMoved = new Subject<void>()
|
||||
private windowFocused = new Subject<void>()
|
||||
private displayMetricsChanged = new Subject<void>()
|
||||
private logger: Logger
|
||||
private windowId: number
|
||||
@ -85,6 +86,8 @@ export class HostAppService {
|
||||
|
||||
get windowMoved$ (): Observable<void> { return this.windowMoved }
|
||||
|
||||
get windowFocused$ (): Observable<void> { return this.windowFocused }
|
||||
|
||||
get displayMetricsChanged$ (): Observable<void> { return this.displayMetricsChanged }
|
||||
|
||||
private constructor (
|
||||
@ -128,6 +131,10 @@ export class HostAppService {
|
||||
this.zone.run(() => this.windowMoved.next())
|
||||
})
|
||||
|
||||
electron.ipcRenderer.on('host:window-focused', () => {
|
||||
this.zone.run(() => this.windowFocused.next())
|
||||
})
|
||||
|
||||
electron.ipcRenderer.on('host:display-metrics-changed', () => {
|
||||
this.zone.run(() => this.displayMetricsChanged.next())
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user