potentially fixed #576

This commit is contained in:
Eugene Pankov
2018-12-29 13:27:45 +01:00
parent 92afec75e7
commit 8793613117
3 changed files with 22 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import { Subject, Observable } from 'rxjs'
import { debounceTime } from 'rxjs/operators'
import { BrowserWindow, app, ipcMain, Rectangle } from 'electron'
import ElectronConfig = require('electron-config')
import * as os from 'os'
@@ -143,6 +144,16 @@ export class Window {
this.visible.next(false)
})
let moveSubscription = new Observable<void>(observer => {
this.window.on('move', () => observer.next())
}).pipe(debounceTime(250)).subscribe(() => {
this.window.webContents.send('host:window-moved')
})
this.window.on('closed', () => {
moveSubscription.unsubscribe()
})
this.window.on('enter-full-screen', () => this.window.webContents.send('host:window-enter-full-screen'))
this.window.on('leave-full-screen', () => this.window.webContents.send('host:window-leave-full-screen'))