Skip to content

macOS: Icon Composer bundle icon and a Dock icon for unbundled runs (port of tobi/disktree#103) - #7

Merged
Harold Hunt (huntharo) merged 5 commits into
mainfrom
port/dock-icon
Oct 30, 2026
Merged

Harold Hunt (huntharo) merged 5 commits into
mainfrom
port/dock-icon

Conversation

@huntharo

@huntharo Harold Hunt (huntharo) commented Oct 29, 2026 •

Copy link
Copy Markdown

Ports tobi/disktree#103 ("macOS: Squircle dock icon, stop hitting icon edges, and set the dock icon when running dev builds") to PwrDisk. It fixes two icon problems:

  • A run outside the bundle has no Dock icon. make run, cargo run and the bare binary showed the generic "exec" tile. dock_icon.rs now sets the Dock icon from an embedded PNG when the main bundle names no icon: DockIcon-glass.png on macOS 26 and later, DockIcon.png before that.
  • macOS 26 has to guess at the bundled icon. packaging/macos/AppIcon.icon is now an Icon Composer package. When Xcode 26's actool is present, cargo xtask bundle compiles it into Assets.car and sets CFBundleIconName. AppIcon.icns stays for macOS 15 and earlier. The mark is drawn as a squircle inside the squircle, so it no longer runs into the mask's corners.

The design is the one from the upstream PR (and the closed huntharo#8): Icon Composer for the bundle, with the Liquid Glass baked into a PNG for unbundled runs. macOS never applies glass to an image set at run time; make dock-icons redraws that PNG through macOS itself.

Before and after

The bundled icon as macOS draws it (NSWorkspace.icon(forFile:), 512 px). Left: pwrdisk/rename's PwrDisk.app, with the panel running into the mask. Right: this branch's.

Bundled icon, before and after

The Dock with two unbundled runs (the bare pwrdisk binary copied out of each bundle). Left: pwrdisk/rename, the exec tile. Right: this branch.

Dock: exec tile before, PwrDisk icon after

Captured on macOS 27.0.1 with Xcode's actool, from ad hoc make bundle builds.

Commits

All five upstream commits, with their authorship, replayed onto main. Conflicts in AGENTS.md, Makefile and Info.plist.in were only the rename's lines meeting the icon's lines, and were resolved in place. What changed for the fork:

  • ci.yml's new Bundle (macOS 26) job checks target/bundle/PwrDisk.app.
  • render-dock-icons.swift's throwaway render bundle is named PwrDisk, with a com.pwrdrvr.pwrdisk.dock-icon-render.* identifier, so nothing under io.github.tobi.disktree is registered with Launch Services.

The icon-building logic (actool compile, @ICON_CATALOG@, the fallback note) is all in xtask/src/bundle.rs, so the signing and Velopack branches pick it up through cargo xtask bundle.

release.yml: reconcile with the Velopack PR

This PR's only release change is in the macOS job's matrix: the aarch64 build moves from macos-15 to macos-26, so the shipped arm64 app carries Assets.car. There is no macOS 26 Intel runner, so x86_64 stays on macos-15-intel with the legacy icon alone.

Left out

Nothing from the upstream PR. The mark-size commit ("Inset the macOS 26 icon's mark…"), which upstream called droppable, is kept: it is what the after images show.

Verified

  • cargo xtask lint and cargo xtask test pass on macOS 27.0.1.
  • make bundle gives Assets.car and AppIcon.icns in Resources, with CFBundleIconFile = AppIcon and CFBundleIconName = Icon.
  • The Dock images are captures of the running binaries, not the PNGs.
  • Not verified: macOS 15, which should still draw AppIcon.icns as before. make dock-icons was not re-run here, so the PNGs are upstream's.

…ser one

A run outside the app bundle has no icon for macOS to draw, so the Dock
shows the generic executable. dock_icon.rs now paints one when the main
bundle names none: the flat legacy tile, or on macOS 26 the shipped icon
as that macOS draws it, since Liquid Glass is never applied to an image
set at run time. make dock-icons renders both, the glass one by macOS
itself through NSWorkspace from a throwaway bundle.

The bundle also ships packaging/macos/AppIcon.icon when Xcode 26's actool
is at hand: Assets.car and CFBundleIconName beside the icns, so macOS 26
draws its own shape and glass instead of normalizing a padded icns, which
26.6.2 puts on a light plate. Without that actool the bundle is as before.
CI builds the bundle on macos-26 too, and the aarch64 release moves there.
…con at size

macOS 26 reports 16.0 to a binary linked against an older SDK, so
NSProcessInfo picked the flat icon for a build made with the Command Line
Tools or Xcode 16. The kernel release does not depend on the SDK.

The flat Dock icon now comes from sips at 512 px, as the iconset does,
rather than a resample of the 1024 px check render. The plist marker is
the bare token, so a reindented template still takes it.
The style check compared the glass and flat renders at the mark's title
bar and green block, which only line up while AppGlyph.svg draws the mark
at the flat icon's size. A smaller mark put the title-bar probe on the
tile, and the script blamed the icon style. The probes are now the canvas
centre, which is the mark's green block at any centred size, and the tile
just inside its edge.
render-dock-icons.swift passed a literal 11.0 to actool while xtask passes
DEPLOYMENT_TARGET, so raising the target would bake the Dock icon's glass
from a different catalog than the one the bundle ships. The script now
reads LSMinimumSystemVersion from Info.plist.in, which xtask's test keeps
equal to DEPLOYMENT_TARGET. Also correct the plist marker's comment: an
empty replacement leaves the line's indent, not a blank line.
At the full 1024 pt canvas the mark's panel reached 80 pt from the edge
and macOS 26's mask clipped its square corners. The panel is now 700 pt,
68% of the canvas and 162 pt in from each edge, about the weight of
Slack's glyph or 1Password's ring beside it in the Dock, with 100 pt
corners so it reads as a squircle inside the squircle, as Finder's does.

Only the Icon Composer layer and the glass Dock icon change. Drop this
commit to keep the mark at full size.
@huntharo
Harold Hunt (huntharo) merged commit e1492ce into main Oct 30, 2026
13 of 14 checks passed
Harold Hunt (huntharo) added a commit that referenced this pull request Oct 30, 2026
#7 added bundle-macos-26 after #12's classifier test began listing every
CI job, so main's Classify Changes fails. The job runs unless the
classifier says non-code only, as its neighbours do.
@huntharo
Harold Hunt (huntharo) deleted the port/dock-icon branch November 9, 2026 03:30
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.

1 participant