Fix Windows tray state

After this PR, the Windows tray state will be correct. "Show
WebTorrent" vs. "Hide WebTorrent"
This commit is contained in:
Feross Aboukhadijeh
2016-06-02 21:16:10 -07:00
parent 5d410457ce
commit 0ec6fb5a93

View File

@@ -51,15 +51,11 @@ function init () {
menu.onToggleFullScreen(main.win.isFullScreen())
})
win.on('blur', function () {
menu.onWindowBlur()
tray.onWindowBlur()
})
win.on('blur', onWindowBlur)
win.on('focus', onWindowFocus)
win.on('focus', function () {
menu.onWindowFocus()
tray.onWindowFocus()
})
win.on('hide', onWindowBlur)
win.on('show', onWindowFocus)
win.on('enter-full-screen', function () {
menu.onToggleFullScreen(true)
@@ -207,6 +203,16 @@ function toggleFullScreen (flag) {
main.win.setFullScreen(flag)
}
function onWindowBlur () {
menu.onWindowBlur()
tray.onWindowBlur()
}
function onWindowFocus () {
menu.onWindowFocus()
tray.onWindowFocus()
}
function getIconPath () {
return process.platform === 'win32'
? config.APP_ICON + '.ico'