mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-29 15:59:54 +00: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 => {
|
ipcMain.on('window-focus', event => {
|
||||||
if (!this.window || event.sender !== this.window.webContents) {
|
if (!this.window || event.sender !== this.window.webContents) {
|
||||||
return
|
return
|
||||||
|
@ -83,6 +83,10 @@ export class AppService {
|
|||||||
this.startTabStorage()
|
this.startTabStorage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hostApp.windowFocused$.subscribe(() => {
|
||||||
|
this._activeTab?.emitFocused()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
startTabStorage () {
|
startTabStorage () {
|
||||||
|
@ -39,6 +39,7 @@ export class HostAppService {
|
|||||||
private configChangeBroadcast = new Subject<void>()
|
private configChangeBroadcast = new Subject<void>()
|
||||||
private windowCloseRequest = new Subject<void>()
|
private windowCloseRequest = new Subject<void>()
|
||||||
private windowMoved = new Subject<void>()
|
private windowMoved = new Subject<void>()
|
||||||
|
private windowFocused = new Subject<void>()
|
||||||
private displayMetricsChanged = new Subject<void>()
|
private displayMetricsChanged = new Subject<void>()
|
||||||
private logger: Logger
|
private logger: Logger
|
||||||
private windowId: number
|
private windowId: number
|
||||||
@ -85,6 +86,8 @@ export class HostAppService {
|
|||||||
|
|
||||||
get windowMoved$ (): Observable<void> { return this.windowMoved }
|
get windowMoved$ (): Observable<void> { return this.windowMoved }
|
||||||
|
|
||||||
|
get windowFocused$ (): Observable<void> { return this.windowFocused }
|
||||||
|
|
||||||
get displayMetricsChanged$ (): Observable<void> { return this.displayMetricsChanged }
|
get displayMetricsChanged$ (): Observable<void> { return this.displayMetricsChanged }
|
||||||
|
|
||||||
private constructor (
|
private constructor (
|
||||||
@ -128,6 +131,10 @@ export class HostAppService {
|
|||||||
this.zone.run(() => this.windowMoved.next())
|
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', () => {
|
electron.ipcRenderer.on('host:display-metrics-changed', () => {
|
||||||
this.zone.run(() => this.displayMetricsChanged.next())
|
this.zone.run(() => this.displayMetricsChanged.next())
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user