[PR #1572] [MERGED] macOS: the game shows as Horizon, with its icon, in the Dock and Cmd+Tab #3599

Closed
opened 2026-11-03 04:10:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1572
Author: @ludovic111
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: fix/mac-dock-icon


📝 Commits (1)

  • 6a698c4 Launcher: start the game from a Horizon.app on macOS, so the Dock and Cmd+Tab show Horizon

📊 Changes

5 files changed (+167 additions, -3 deletions)

View changed files

📝 launcher/src/backend.rs (+13 -1)
➕ launcher/src/game_app.rs (+146 -0)
📝 launcher/src/lib.rs (+2 -0)
📝 launcher/src/servers.rs (+3 -2)
📝 launcher/src/servers/tests.rs (+3 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

On macOS the game had no icon in the Dock (reported on Discord by scanfee). The launcher starts it as a bare executable (versions/<tag>/horizon-client). macOS then shows it as "horizon-client" with the generic "exec" icon in the Dock, in Cmd+Tab and in the menu bar. winit's with_window_icon does nothing on macOS, and vanilla's GLFW window icon doesn't either: vanilla relies on its launcher.

The launcher now keeps a small Horizon.app in each version folder and starts the game from it:

  • Contents/Info.plist: name "Horizon", identifier dev.horizon.game (separate from the launcher's dev.horizon.launcher), NSHighResolutionCapable, and the games category, which lets macOS turn on Game Mode in full screen.
  • Contents/Resources/horizon.icns: the launcher's own icon (packaging/icons/horizon.icns).
  • Contents/MacOS/horizon-client and horizon-ctl: hard links to the version's programs. They use no extra disk space, and the release's signature is untouched. horizon-ctl is linked because the game looks for it beside itself (Copy Connection Details).

game_app::ensure runs on every play, so versions that are already installed get the bundle too. If a version's program was replaced (a reinstall, or a build copied over), it is linked again. If the bundle can't be made, the game starts from the bare binary as before. The server setup (servers::copy_release) leaves the bundle out of its copy.

Why a bundle, not NSApplication.applicationIconImage

Both were tested on this Mac with a small probe binary:

  • Icon set at run time: the Dock and Cmd+Tab icon are right, but Cmd+Tab and LaunchServices still name it "horizon-client". Embedding an Info.plist in the executable (__TEXT,__info_plist) doesn't change that either.
  • Bundle: started directly from Horizon.app/Contents/MacOS/ (no open), LaunchServices names it "Horizon", and it shows Horizon's icon in the Dock and in Cmd+Tab.

So the bundle is the only one of the two that also fixes the name. It is also launcher-only: the release packaging, the game binary, signing and notarization are unchanged.

Other platforms (code reading; not run)

  • Windows: crates/horizon-client/build.rs embeds packaging/icons/horizon.ico as icon resource 1 (the release builds it on windows-latest), and winit sets the window's small icon. Explorer, the taskbar and the title bar have Horizon's icon. Nothing to fix; not seen on a real Windows machine.
  • Linux: X11 gets _NET_WM_ICON from with_window_icon, and WM_CLASS / the Wayland app id are horizon (winit's with_name sets the same field for both). A release launcher installs the hidden horizon.desktop (StartupWMClass=horizon, Icon=horizon) and the hicolor icons when it starts. Nothing to fix; not seen on a Linux desktop (that needs vscreen on the desktop).

How tested

On the Mac mini, with the released v0.2.46 game, in fresh mktemp-style homes (HORIZON_LAUNCHER_HOME, HORIZON_HOME, XDG_DATA_HOME, XDG_CONFIG_HOME, HORIZON_LAUNCHER_NO_SELF_UPDATE=1, HORIZON_NO_AUDIO=1), each launcher ran horizon-launcher play --world dock --creative:

Released launcher 0.2.4 This branch's launcher
lsappinfo name / bundle id "horizon-client" / NULL "Horizon" / dev.horizon.game
Dock tile generic "exec" Horizon "H"
Cmd+Tab generic "exec" Horizon "H", labelled "Horizon"
Menu bar app name horizon-client Horizon

The bundle's horizon-client has the same inode as versions/v0.2.46/horizon-client. The window opened at the same size and sharpness as before, so its HiDPI scale is unchanged, and the world loaded and played. Before and after screenshots of the Dock and Cmd+Tab are with the orchestrator.

New tests: game_app::tests (links, a replaced binary is relinked, a version without horizon-ctl, a version without the game falls back) and servers::tests::programs_are_laid_out_as_install_sh_does (the server copy skips Horizon.app).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 46f4237b6, 1 min 40 s)

Check Result
Scope ✅ 5 files, +167 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (49 s)
launcher tests ✅ 118 passed (26 s)
Parity ➖ no harness affected
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Needs Ludovic

Nothing to decide. It reaches players with the next launcher release (the game release doesn't change).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1572 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/mac-dock-icon` --- ### 📝 Commits (1) - [`6a698c4`](https://github.com/horizon-rust/horizon/commit/6a698c40f00964a6fe51f27453c23dc51f297f3c) Launcher: start the game from a Horizon.app on macOS, so the Dock and Cmd+Tab show Horizon ### 📊 Changes **5 files changed** (+167 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `launcher/src/backend.rs` (+13 -1) ➕ `launcher/src/game_app.rs` (+146 -0) 📝 `launcher/src/lib.rs` (+2 -0) 📝 `launcher/src/servers.rs` (+3 -2) 📝 `launcher/src/servers/tests.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What On macOS the game had no icon in the Dock (reported on Discord by scanfee). The launcher starts it as a bare executable (`versions/<tag>/horizon-client`). macOS then shows it as **"horizon-client" with the generic "exec" icon** in the Dock, in Cmd+Tab and in the menu bar. winit's `with_window_icon` does nothing on macOS, and vanilla's GLFW window icon doesn't either: vanilla relies on its launcher. The launcher now keeps a small `Horizon.app` in each version folder and starts the game from it: - `Contents/Info.plist`: name "Horizon", identifier `dev.horizon.game` (separate from the launcher's `dev.horizon.launcher`), `NSHighResolutionCapable`, and the games category, which lets macOS turn on Game Mode in full screen. - `Contents/Resources/horizon.icns`: the launcher's own icon (`packaging/icons/horizon.icns`). - `Contents/MacOS/horizon-client` and `horizon-ctl`: **hard links** to the version's programs. They use no extra disk space, and the release's signature is untouched. `horizon-ctl` is linked because the game looks for it beside itself (Copy Connection Details). `game_app::ensure` runs on every play, so versions that are already installed get the bundle too. If a version's program was replaced (a reinstall, or a build copied over), it is linked again. If the bundle can't be made, the game starts from the bare binary as before. The server setup (`servers::copy_release`) leaves the bundle out of its copy. ## Why a bundle, not `NSApplication.applicationIconImage` Both were tested on this Mac with a small probe binary: - **Icon set at run time:** the Dock and Cmd+Tab icon are right, but Cmd+Tab and LaunchServices still name it **"horizon-client"**. Embedding an Info.plist in the executable (`__TEXT,__info_plist`) doesn't change that either. - **Bundle:** started directly from `Horizon.app/Contents/MacOS/` (no `open`), LaunchServices names it **"Horizon"**, and it shows Horizon's icon in the Dock and in Cmd+Tab. So the bundle is the only one of the two that also fixes the name. It is also launcher-only: the release packaging, the game binary, signing and notarization are unchanged. ## Other platforms (code reading; not run) - **Windows:** `crates/horizon-client/build.rs` embeds `packaging/icons/horizon.ico` as icon resource 1 (the release builds it on `windows-latest`), and winit sets the window's small icon. Explorer, the taskbar and the title bar have Horizon's icon. Nothing to fix; not seen on a real Windows machine. - **Linux:** X11 gets `_NET_WM_ICON` from `with_window_icon`, and WM_CLASS / the Wayland app id are `horizon` (winit's `with_name` sets the same field for both). A release launcher installs the hidden `horizon.desktop` (`StartupWMClass=horizon`, `Icon=horizon`) and the hicolor icons when it starts. Nothing to fix; not seen on a Linux desktop (that needs vscreen on the desktop). ## How tested On the Mac mini, with the released v0.2.46 game, in fresh `mktemp`-style homes (`HORIZON_LAUNCHER_HOME`, `HORIZON_HOME`, `XDG_DATA_HOME`, `XDG_CONFIG_HOME`, `HORIZON_LAUNCHER_NO_SELF_UPDATE=1`, `HORIZON_NO_AUDIO=1`), each launcher ran `horizon-launcher play --world dock --creative`: | | Released launcher 0.2.4 | This branch's launcher | | --- | --- | --- | | `lsappinfo` name / bundle id | `"horizon-client"` / NULL | `"Horizon"` / `dev.horizon.game` | | Dock tile | generic "exec" | Horizon "H" | | Cmd+Tab | generic "exec" | Horizon "H", labelled "Horizon" | | Menu bar app name | horizon-client | Horizon | The bundle's `horizon-client` has the same inode as `versions/v0.2.46/horizon-client`. The window opened at the same size and sharpness as before, so its HiDPI scale is unchanged, and the world loaded and played. Before and after screenshots of the Dock and Cmd+Tab are with the orchestrator. New tests: `game_app::tests` (links, a replaced binary is relinked, a version without horizon-ctl, a version without the game falls back) and `servers::tests::programs_are_laid_out_as_install_sh_does` (the server copy skips `Horizon.app`). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 46f4237b6, 1 min 40 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +167 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (49 s) | | launcher tests | ✅ 118 passed (26 s) | | Parity | ➖ no harness affected | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Needs Ludovic Nothing to decide. It reaches players with the next launcher release (the game release doesn't change). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:42 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3599
No description provided.