Repository navigation
macOS: Icon Composer bundle icon and a Dock icon for unbundled runs (port of tobi/disktree#103) - #7
Merged
Merged
Conversation
Harold Hunt (huntharo)
force-pushed
the
port/dock-icon
branch
from
October 29, 2026 23:12
b2c40dc to
c225b3b
Compare
Harold Hunt (huntharo)
force-pushed
the
port/dock-icon
branch
from
October 30, 2026 00:25
c225b3b to
2202dcd
Compare
…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.
Harold Hunt (huntharo)
force-pushed
the
port/dock-icon
branch
from
October 30, 2026 01:22
2202dcd to
82269a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
make run,cargo runand the bare binary showed the generic "exec" tile.dock_icon.rsnow sets the Dock icon from an embedded PNG when the main bundle names no icon:DockIcon-glass.pngon macOS 26 and later,DockIcon.pngbefore that.packaging/macos/AppIcon.iconis now an Icon Composer package. When Xcode 26'sactoolis present,cargo xtask bundlecompiles it intoAssets.carand setsCFBundleIconName.AppIcon.icnsstays 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-iconsredraws that PNG through macOS itself.Before and after
The bundled icon as macOS draws it (
NSWorkspace.icon(forFile:), 512 px). Left:pwrdisk/rename'sPwrDisk.app, with the panel running into the mask. Right: this branch's.The Dock with two unbundled runs (the bare
pwrdiskbinary copied out of each bundle). Left:pwrdisk/rename, the exec tile. Right: this branch.Captured on macOS 27.0.1 with Xcode's actool, from ad hoc
make bundlebuilds.Commits
All five upstream commits, with their authorship, replayed onto main. Conflicts in
AGENTS.md,MakefileandInfo.plist.inwere 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 checkstarget/bundle/PwrDisk.app.render-dock-icons.swift's throwaway render bundle is named PwrDisk, with acom.pwrdrvr.pwrdisk.dock-icon-render.*identifier, so nothing underio.github.tobi.disktreeis registered with Launch Services.The icon-building logic (actool compile,
@ICON_CATALOG@, the fallback note) is all inxtask/src/bundle.rs, so the signing and Velopack branches pick it up throughcargo 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-15tomacos-26, so the shipped arm64 app carriesAssets.car. There is no macOS 26 Intel runner, so x86_64 stays onmacos-15-intelwith the legacy icon alone.macos-26, or Xcode 26 selected, soactool26 is there. Otherwise the bundle quietly falls back to the.icns, andcargo xtask bundleonly prints a note. The CI job'sIcon catalogcheck (Assets.carpresent,CFBundleIconName = Icon) is worth copying there.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 lintandcargo xtask testpass on macOS 27.0.1.make bundlegivesAssets.carandAppIcon.icnsin Resources, withCFBundleIconFile = AppIconandCFBundleIconName = Icon.AppIcon.icnsas before.make dock-iconswas not re-run here, so the PNGs are upstream's.