bring window to front when called from CLI (fixes #489)

This commit is contained in:
Eugene Pankov
2018-10-31 17:37:34 +01:00
parent 215ddf0eec
commit 4426d4827f
3 changed files with 18 additions and 0 deletions

View File

@@ -224,6 +224,17 @@ export class Window {
this.window.setTitle(title)
})
ipcMain.on('window-bring-to-front', event => {
if (event.sender !== this.window.webContents) {
return
}
if (this.window.isMinimized()) {
this.window.restore()
}
this.window.show()
this.window.moveTop()
})
this.window.webContents.on('new-window', event => event.preventDefault())
}