Make macos icon persistent even when app is closed

pull/8230/head
Nicholas Mata 2025-08-14 03:14:35 -07:00 committed by Mitchell Hashimoto
parent 66e5081721
commit 29419e7aac
1 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,9 @@ class AppDelegate: NSObject,
@Published private(set) var appIcon: NSImage? = nil {
didSet {
NSApplication.shared.applicationIconImage = appIcon
let appPath = Bundle.main.bundlePath
NSWorkspace.shared.setIcon(appIcon, forFile: appPath, options: [])
NSWorkspace.shared.noteFileSystemChanged(appPath)
}
}