fix: close main window exits app; playlist panel close doesn't

This commit is contained in:
yumoqing 2026-06-25 20:47:23 +08:00
parent 8cfb072370
commit f5e35a6ee7

View File

@ -5,9 +5,12 @@ import SwiftBricks
#if os(macOS)
import AppKit
// 退
// 退 NSPanel退
class AppDel: NSObject, NSApplicationDelegate {
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { false }
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
// NSPanel退
return !sender.windows.contains { !($0 is NSPanel) }
}
}
#endif