修复 MacOS 下点击 dock 右键菜单的退出按钮时,程序没有退出的问题(#1923)
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user