[PR #1793] [MERGED] Launcher: pin the macOS title bar to the chosen appearance #3764

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

📋 Pull Request Information

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

Base: main ← Head: launcher-dark-titlebar


📝 Commits (2)

  • 3740de5 Launcher: pin the macOS title bar to the chosen appearance
  • 98bebd2 Launcher: one place reads the pinned appearance (theme::pinned_dark)

📊 Changes

5 files changed (+76 additions, -15 deletions)

View changed files

📝 launcher/Cargo.lock (+2 -0)
📝 launcher/Cargo.toml (+4 -0)
📝 launcher/src/main.rs (+4 -0)
📝 launcher/src/theme.rs (+25 -14)
📝 launcher/src/titlebar.rs (+41 -1)

📄 Description

🤖 Opened by an AI agent (Devin) on behalf of socksprox, not by a human.

Summary

  • launcher/src/titlebar.rs: apply_appearance pins the NSWindow's appearance to the player's choice — Dark/Light set NSAppearanceNameDarkAqua/NSAppearanceNameAqua on the native window (reached through the raw AppKit handle), System clears the pin so the chrome follows the computer again. It honours the same HORIZON_LAUNCHER_APPEARANCE override the theme does. No-op off macOS.
  • launcher/src/main.rs: applied in Launcher::new (before the theme reads window.appearance(), so page and chrome agree from the first frame) and when the Appearance segments change.
  • launcher/Cargo.toml: objc2-app-kit + raw-window-handle, macOS-only, both already in the lockfile through gpui/wgpu.

gpui 0.2.2 exposes no way to set a window's appearance, so the native title bar could only follow the system: a launcher set to Dark (the default) still drew a light title bar on a light desktop.

Verification

  • python3 tools/pr_ready.py --quick: fmt, clippy -D warnings, launcher tests all pass

pr_ready (tools/pr_ready.py --quick on MacBookPro, against origin/main at ad63f2e96, 10 s)

Check Result
Scope ✅ 4 files, +58 −1
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (4 s)
launcher tests ✅ 119 passed (3 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

Test plan

  • macOS, system light + launcher Appearance Dark → dark title bar
  • macOS, Appearance Light on a dark system → light title bar
  • macOS, Appearance System → title bar follows the computer again
  • CI

🤖 Generated with Devin (Cognition)


🔄 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/1793 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `launcher-dark-titlebar` --- ### 📝 Commits (2) - [`3740de5`](https://github.com/horizon-rust/horizon/commit/3740de5116dbf9322e39d18c3ce0777d087d0401) Launcher: pin the macOS title bar to the chosen appearance - [`98bebd2`](https://github.com/horizon-rust/horizon/commit/98bebd26bdc33efaa4483ac5d5cbb07250fc1345) Launcher: one place reads the pinned appearance (theme::pinned_dark) ### 📊 Changes **5 files changed** (+76 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `launcher/Cargo.lock` (+2 -0) 📝 `launcher/Cargo.toml` (+4 -0) 📝 `launcher/src/main.rs` (+4 -0) 📝 `launcher/src/theme.rs` (+25 -14) 📝 `launcher/src/titlebar.rs` (+41 -1) </details> ### 📄 Description > 🤖 Opened by an AI agent (Devin) on behalf of socksprox, not by a human. ## Summary - `launcher/src/titlebar.rs`: `apply_appearance` pins the NSWindow's appearance to the player's choice — `Dark`/`Light` set `NSAppearanceNameDarkAqua`/`NSAppearanceNameAqua` on the native window (reached through the raw AppKit handle), `System` clears the pin so the chrome follows the computer again. It honours the same `HORIZON_LAUNCHER_APPEARANCE` override the theme does. No-op off macOS. - `launcher/src/main.rs`: applied in `Launcher::new` (before the theme reads `window.appearance()`, so page and chrome agree from the first frame) and when the Appearance segments change. - `launcher/Cargo.toml`: `objc2-app-kit` + `raw-window-handle`, macOS-only, both already in the lockfile through gpui/wgpu. gpui 0.2.2 exposes no way to set a window's appearance, so the native title bar could only follow the system: a launcher set to Dark (the default) still drew a light title bar on a light desktop. ## Verification - `python3 tools/pr_ready.py --quick`: fmt, `clippy -D warnings`, launcher tests all pass **pr_ready** (`tools/pr_ready.py --quick` on MacBookPro, against origin/main at ad63f2e96, 10 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +58 −1 | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (4 s) | | launcher tests | ✅ 119 passed (3 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | #### Test plan - [ ] macOS, system light + launcher Appearance Dark → dark title bar - [ ] macOS, Appearance Light on a dark system → light title bar - [ ] macOS, Appearance System → title bar follows the computer again - [ ] CI 🤖 Generated with Devin (Cognition) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:08 +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#3764
No description provided.