upgrade: beta fix: macosx close bug

This commit is contained in:
yanghy 2022-12-11 19:09:09 +08:00
parent 6322108bc0
commit 394465629c

View File

@ -474,26 +474,18 @@ func (m *BaseWindow) registerDefaultChromiumCloseEvent() {
m.chromium.SetOnClose(func(sender lcl.IObject, browser *ICefBrowser, aAction *TCefCloseBrowsesAction) {
logger.Debug("chromium.onClose")
if IsDarwin() { //MacOSX
*aAction = CbaClose
desChildWind := m.windowParent.DestroyChildWindow()
logger.Debug("chromium.onClose => windowParent.DestroyChildWindow:", desChildWind)
} else { // Window and Linux
//QueueAsyncCall(func(id int) { //main thread run
// m.windowParent.Free()
// logger.Debug("chromium.onClose => windowParent.Free")
//})
} else if IsLinux() {
*aAction = CbaClose
} else if IsWindows() {
*aAction = CbaDelay
}
QueueAsyncCall(func(id int) { //main thread run
m.windowParent.Free()
logger.Debug("chromium.onClose => windowParent.Free")
})
*aAction = CbaClose
//if IsLinux() {
// //继续关闭 -> OnBeforeClose
// *aAction = CbaClose
//} else {
// //暂时停止关闭 -> OnBeforeClose
// *aAction = CbaDelay
//}
if bwEvent.onClose != nil {
bwEvent.onClose(sender, browser, aAction)
}