Skip to content

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

Closed

Description

@ChivanCOM

Description

On macOS Tahoe (macOS 26), Uno's native layer (libUnoNativeMac.dylib) calls [NSApp setApplicationIconImage:] at startup, overriding the OS's Liquid Glass dock icon with the default-appearance variant. This causes a visible mid-launch icon flip: the correct appearance-aware icon shows briefly in the dock, then gets replaced by Uno's flat default rendering.

The root cause is that uno_application_set_icon() in the native dylib reads CFBundleIconName from Info.plist, loads the icon via [NSImage imageNamed:] (which returns the default appearance variant without any appearance context), and calls setApplicationIconImage: — clobbering whatever macOS had already set from Assets.car with full dark/tinted/clear appearance support.

Steps to Reproduce

  1. Create a Uno Skia Desktop app targeting net9.0-desktop with osx-arm64
  2. Add <UnoIcon Include="Assets/Icons/icon.png" /> to csproj
  3. Build with dotnet publish -p:PackageFormat=app on macOS Tahoe
  4. The generated .app bundle has CFBundleIconName in Info.plist and Assets.car in Resources
  5. Launch the app
  6. Observe the dock icon: correct Liquid Glass variant appears briefly, then flips to the default/flat variant

Expected Behavior

The dock icon should remain as the OS rendered it from Assets.car — respecting the user's appearance mode (light, dark, tinted, clear). Uno should not override the dock icon at runtime.

Actual Behavior

libUnoNativeMac.dylib calls [NSApp setApplicationIconImage:] with the default-appearance variant from [NSImage imageNamed:], replacing the Liquid Glass icon with a flat rendering. Visible as a mid-launch flip.

Workaround

Strip CFBundleIconName from Info.plist AND remove Assets.car from the shipped bundle. This prevents Uno's native lookup from finding anything to override with. The dock icon then falls back to CFBundleIconFile → classic .icns, which macOS renders without Uno interference.

Downside: losing Assets.car means no Liquid Glass appearance variants at all — users on Tahoe with dark/tinted/clear modes see only the default colored icon.

For Mac App Store builds this workaround is not viable because Apple requires Assets.car (ITMS-90546).

Suggested Fix

One of:

  1. Don't call setApplicationIconImage: at all — let macOS handle the dock icon entirely from the bundle's Assets.car / CFBundleIconName. The only reason to call it would be runtime icon changes, which desktop apps rarely need.

  2. Use an appearance-aware API — if Uno must set the icon programmatically, use an API that respects the current NSAppearance context rather than [NSImage imageNamed:] which returns the default variant.

  3. Add an opt-out — a csproj property like <UnoMacOSSetApplicationIcon>false</UnoMacOSSetApplicationIcon> so developers can disable the runtime override when they want the OS to handle the icon.

Environment

  • Uno.Sdk: 6.5.31
  • .NET: 9.0, TFM net9.0-desktop
  • macOS: Tahoe (26) on Apple Silicon (osx-arm64)
  • Xcode: 26.x
  • Observed on both PackageFormat=app and PackageFormat=dmg outputs

Investigation Notes

We traced this through five layers before identifying libUnoNativeMac.dylib → uno_application_set_icon() → [NSApp setApplicationIconImage:] as the root cause:

  1. CFBundleIconName + Assets.car — Uno's [NSImage imageNamed:] returns default variant
  2. Assets.xcassets/ resizetizer output in Contents/MacOS/ — stripped, didn't fix alone
  3. Assets/Icons/*.scale-*.png — stripped, didn't fix alone
  4. <UnoIcon> csproj item — was a red herring; Package.appxmanifest overrode it
  5. Package.appxmanifest — deleting it AND removing UnoIcon finally stopped the flip, but at the cost of losing all icon support from Uno's build system

Activity

  1. added theissue type on Apr 17, 2026
  2. spouliot commented on Apr 30, 2026

    @spouliot
    Contributor

    @ajpinedam there is is_bundle flag that should be used to keep the current behaviour for non bundled apps (including development) to avoid the default executable icon.

    Otherwise, if a bundle is present, all the information should be present for macOS to do the right thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions