fixed titlebar not adjusting to macOS fullscreen mode - fixes #4274

This commit is contained in:
Eugene Pankov
2021-08-15 14:40:40 +02:00
parent f7b0272be5
commit 03045eb952
2 changed files with 18 additions and 20 deletions

View File

@@ -12,9 +12,9 @@ export interface Bounds {
@Injectable({ providedIn: 'root' })
export class ElectronHostWindow extends HostWindowService {
get isFullscreen (): boolean { return this._isFullScreen}
get isFullscreen (): boolean { return this._isFullscreen }
private _isFullScreen = false
private _isFullscreen = false
constructor (
zone: NgZone,
@@ -23,28 +23,26 @@ export class ElectronHostWindow extends HostWindowService {
) {
super()
electron.ipcRenderer.on('host:window-enter-full-screen', () => zone.run(() => {
this._isFullScreen = true
this._isFullscreen = true
}))
electron.ipcRenderer.on('host:window-leave-full-screen', () => zone.run(() => {
this._isFullScreen = false
this._isFullscreen = false
}))
electron.ipcRenderer.on('host:window-shown', () => {
zone.run(() => this.windowShown.next())
})
electron.ipcRenderer.on('host:window-shown', () => zone.run(() => this.windowShown.next()))
electron.ipcRenderer.on('host:window-close-request', () => {
zone.run(() => this.windowCloseRequest.next())
})
electron.ipcRenderer.on('host:window-close-request', () => zone.run(() => {
this.windowCloseRequest.next()
}))
electron.ipcRenderer.on('host:window-moved', () => {
zone.run(() => this.windowMoved.next())
})
electron.ipcRenderer.on('host:window-moved', () => zone.run(() => {
this.windowMoved.next()
}))
electron.ipcRenderer.on('host:window-focused', () => {
zone.run(() => this.windowFocused.next())
})
electron.ipcRenderer.on('host:window-focused', () => zone.run(() => {
this.windowFocused.next()
}))
}
getWindow (): BrowserWindow {
@@ -64,7 +62,7 @@ export class ElectronHostWindow extends HostWindowService {
}
toggleFullscreen (): void {
this.getWindow().setFullScreen(!this._isFullScreen)
this.getWindow().setFullScreen(!this._isFullscreen)
}
minimize (): void {