Fix Windows tray state
After this PR, the Windows tray state will be correct. "Show WebTorrent" vs. "Hide WebTorrent"
This commit is contained in:
@@ -51,15 +51,11 @@ function init () {
|
|||||||
menu.onToggleFullScreen(main.win.isFullScreen())
|
menu.onToggleFullScreen(main.win.isFullScreen())
|
||||||
})
|
})
|
||||||
|
|
||||||
win.on('blur', function () {
|
win.on('blur', onWindowBlur)
|
||||||
menu.onWindowBlur()
|
win.on('focus', onWindowFocus)
|
||||||
tray.onWindowBlur()
|
|
||||||
})
|
|
||||||
|
|
||||||
win.on('focus', function () {
|
win.on('hide', onWindowBlur)
|
||||||
menu.onWindowFocus()
|
win.on('show', onWindowFocus)
|
||||||
tray.onWindowFocus()
|
|
||||||
})
|
|
||||||
|
|
||||||
win.on('enter-full-screen', function () {
|
win.on('enter-full-screen', function () {
|
||||||
menu.onToggleFullScreen(true)
|
menu.onToggleFullScreen(true)
|
||||||
@@ -207,6 +203,16 @@ function toggleFullScreen (flag) {
|
|||||||
main.win.setFullScreen(flag)
|
main.win.setFullScreen(flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onWindowBlur () {
|
||||||
|
menu.onWindowBlur()
|
||||||
|
tray.onWindowBlur()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onWindowFocus () {
|
||||||
|
menu.onWindowFocus()
|
||||||
|
tray.onWindowFocus()
|
||||||
|
}
|
||||||
|
|
||||||
function getIconPath () {
|
function getIconPath () {
|
||||||
return process.platform === 'win32'
|
return process.platform === 'win32'
|
||||||
? config.APP_ICON + '.ico'
|
? config.APP_ICON + '.ico'
|
||||||
|
|||||||
Reference in New Issue
Block a user