Repository navigation
fix(macos): Don't override dock icon for bundled apps - #23468
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the macOS Skia native window initialization path to avoid overriding the dock icon at runtime when the app is running from a bundled .app, letting macOS render the appearance-aware icon variants from Assets.car / CFBundleIconName (preventing the mid-launch “icon flip” on macOS 26).
Changes:
- Gate the runtime dock icon override behind
!NativeUno.uno_application_is_bundled(), so bundled apps keep the OS-rendered icon. - Keep existing behavior for unbundled/development runs so the app doesn’t fall back to the generic executable icon.
Process note (blocks per repo PR requirements):
- The PR description uses
closes #23072; the repo guidelines require a fully qualified issue link (e.g.,Closes https://github.com/unoplatform/uno/issues/23072).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23468/wasm-skia-net9/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23468/wasm-skia-net9/index.html |
GitHub Issue: closes #23072
PR Type:
🐞 Bugfix
What changed? 🚀
On macOS Tahoe (macOS 26), Uno's native layer called
[NSApp setApplicationIconImage:]at startup for every app, overriding the dock icon that macOS had already rendered from the bundle'sAssets.car/CFBundleIconName. Because the override loads a flat PNG via[NSImage imageNamed:](default appearance variant), it clobbered the appearance-aware (Liquid Glass) light/dark/tinted/clear variants — producing a visible mid-launch icon "flip".This change gates the runtime icon override on the already-existing
uno_application_is_bundled()flag inMacOSWindowNative.UpdateWindowPropertiesFromPackage():.app→ skip the override. macOS renders the dock icon from the bundle'sAssets.car/CFBundleIconNamewith full appearance-aware variants. No more flip.dotnet run, development) → unchanged. Uno still sets the icon programmatically so the app doesn't fall back to the generic executable icon.The window-title fallback at the end of the method is unaffected and still runs in both cases.
This supersedes the issue's manual workaround (stripping
CFBundleIconName+Assets.car), which is not viable for Mac App Store builds (ITMS-90546 requiresAssets.car). With this fix, bundled apps keepAssets.carand get the correct Liquid Glass icon.Note: a bundle that ships a
Package.appxmanifestLogobut no bundle icon info would now fall back to the generic icon rather than the manifest logo — this is the intended "trust the bundle" behavior, and the Uno macOS packaging normally emits the bundle icon anyway.PR Checklist ✅
Screenshots Compare Test Runresults.