Skip to content

feat(macos): make the translucent window surface an opt-in setting - #1788

Merged
vastsa merged 2 commits into
mainfrom
feat/macos-window-translucency-setting
Oct 20, 2026
Merged

vastsa merged 2 commits into
mainfrom
feat/macos-window-translucency-setting

Conversation

@vastsa

@vastsa vastsa commented Oct 20, 2026

Copy link
Copy Markdown
Owner

What

  • Adds Settings → General → Appearance → Translucent window (macOS only).
    Off (and absent) keeps the opaque native surface that keeps the window out of
    WindowServer's per-frame recomposition path ([Bug] macOS:侧栏“运行中”状态动画导致 WindowServer GPU 占用显著升高 #1064); on restores the
    sidebar vibrancy material behind a transparent backing.
  • macosWindowSurfaceOptions(translucent, color) becomes the only declaration of
    the macOS surface; mainWindowBackgroundOptions("darwin", color) still returns
    the opaque one, and applyMainWindowBackground keeps repainting it on theme
    changes.
  • A translucent window keeps its transparent pixels: window.setBackgroundColor
    no longer paints a plugin theme colour over it.
  • Electron fixes transparent at window creation, so the preference is read
    before new BrowserWindow and a change applies on the next launch. The row
    reads the surface the main process actually created (window/control
    getState) and shows a "Restart to apply" badge while the two disagree.

This builds on #1752 by keeping its opaque-surface fix as the default and adding
the user-facing choice the ADR had rejected as a default, not as an option.

Verification

  • apps/desktop typecheck: pass
  • biome lint (repo config): 125 files, no findings
  • apps/desktop node --test: 4143 tests, 4140 pass, 0 fail (3 skipped)
  • packages/shared vitest: 1280 pass; packages/i18n vitest: 30 pass
  • New apps/desktop/test/macos-window-translucency.test.mjs covers the setting
    default, the creation-only surface, the darwin-only row, and write validation.

Not run: verify:ui:* (native translucency is verified by the unit contracts
only; no Electron instance was started).

Docs: ADR 0332 (revised decision), ADR 0248, 04-ux/06-settings-ia.md,
04-ux/08-component-spec.md, 04-ux/07-ui-design-system.md, plugin permissions
matrix, decisions log (D666).

wqx and others added 2 commits October 20, 2026 23:15
The macOS main window stacked the native `sidebar` vibrancy material behind a
transparent Electron surface. WindowServer recomposites that material on every
frame the window stays dirty, so an idle focused window held GPU near 40% on
Apple Silicon while a minimized one returned to the desktop baseline
(issue #1064). Bounding idle indicator animations reduced the load but could not
remove it, because the material itself kept the window in the compositor's
per-frame path regardless of what the renderer painted.

macOS now paints the same opaque native background the other platforms already
use. The frameless `hiddenInset` titlebar, the inset traffic-light position, and
the renderer's sidebar tint and sheen are unchanged, so the surface still reads
as glass over the host palette. `applyNativeThemeSource` no longer re-applies a
material, and the `window.setBackgroundColor` IPC no longer returns early on
darwin, which means a granted `windowAppearance.backgroundColor` plugin theme is
applied on macOS like everywhere else (ADR 0248).

ADR 0330 records the decision and the measurement; the specs that described the
vibrancy plate are updated in the same change.

(cherry picked from commit 1a535a2)
An opaque macOS surface keeps the window out of WindowServer's per-frame
recomposition path (#1064), but it also drops the live wallpaper blur some
users want. The surface is now one explicit choice: opaque by default, and
Settings > General > Appearance > Translucent window restores the sidebar
vibrancy material.

Electron fixes `transparent` when a window is created, so the preference is
read before `new BrowserWindow` and applies on the next launch. The settings
row asks the main process which surface it actually created (window control
getState) and shows a restart hint while the two disagree, rather than
mutating a live window or faking the switch.

`macosWindowSurfaceOptions` is now the only declaration of the macOS surface,
so a theme change keeps repainting the opaque window while a translucent one
keeps its material, and ADR 0332 records the revised decision.
Copilot AI balanced review requested due to automatic review settings October 20, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vastsa
vastsa merged commit 710f493 into main Oct 20, 2026
6 checks passed
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.

2 participants