修复 MacOS 下点击 dock 右键菜单的退出按钮时,程序没有退出的问题(#1923)

This commit is contained in:
lyswhut
2024-06-03 12:49:26 +08:00
parent 7799e511e8
commit 77f51a3e9f
2 changed files with 9 additions and 51 deletions
+8 -11
View File
@@ -14,21 +14,18 @@ const winEvent = () => {
browserWindow.on('close', event => {
if (
global.lx.isSkipTrayQuit ||
!global.lx.appSetting['tray.enable'] ||
// linux下,如果不是点击软件上的关闭按钮退出的操作都直接退出
// https://github.com/lyswhut/lx-music-desktop/issues/191
(isLinux && !global.lx.isTrafficLightClose)
global.lx.appSetting['tray.enable'] &&
(global.lx.isTrafficLightClose || (isWin && !global.lx.isSkipTrayQuit))
) {
browserWindow!.setProgressBar(-1)
// global.lx.mainWindowClosed = true
global.lx.event_app.main_window_close()
global.lx.isTrafficLightClose &&= false
event.preventDefault()
browserWindow!.hide()
return
}
global.lx.isTrafficLightClose &&= false
event.preventDefault()
browserWindow!.hide()
browserWindow!.setProgressBar(-1)
// global.lx.mainWindowClosed = true
global.lx.event_app.main_window_close()
})
browserWindow.on('closed', () => {