Skip to content

fix(macos): Don't override dock icon for bundled apps - #23468

Merged
ajpinedam merged 2 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/fix.macos.dock.icon
Jun 18, 2026
Merged

ajpinedam merged 2 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/fix.macos.dock.icon

Conversation

@ajpinedam

Copy link
Copy Markdown
Contributor

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's Assets.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 in MacOSWindowNative.UpdateWindowPropertiesFromPackage():

  • Bundled .app → skip the override. macOS renders the dock icon from the bundle's Assets.car / CFBundleIconName with full appearance-aware variants. No more flip.
  • Unbundled (e.g. 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 requires Assets.car). With this fix, bundled apps keep Assets.car and get the correct Liquid Glass icon.

Note: a bundle that ships a Package.appxmanifest Logo but 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 ✅

Copilot AI review requested due to automatic review settings June 15, 2026 19:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@unodevops

Copy link
Copy Markdown
Contributor

@ajpinedam ajpinedam self-assigned this Jun 15, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@ajpinedam
ajpinedam merged commit 0ca7691 into unoplatform:master Jun 18, 2026
46 of 47 checks passed
@ajpinedam
ajpinedam deleted the dev/anpi/fix.macos.dock.icon branch June 18, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS Skia: libUnoNativeMac overrides dock icon via setApplicationIconImage, breaks Liquid Glass appearance variants

4 participants