Forward webview visibility change events from browser process

This commit is contained in:
Kevin Sawicki 2017-02-24 10:18:09 -08:00
parent 7564a9973b
commit 1d84d83fd4
4 changed files with 16 additions and 10 deletions

View file

@ -110,7 +110,9 @@ BrowserWindow.prototype._init = function () {
const newState = this.isVisible() && !this.isMinimized()
if (isVisible !== newState) {
isVisible = newState
this.webContents.send('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', isVisible ? 'visible' : 'hidden')
const visibilityState = isVisible ? 'visible' : 'hidden'
this.webContents.send('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', visibilityState)
this.webContents.emit('-window-visibility-change', visibilityState)
}
}