Skip to content

fix(window): add the macOS blur surface for Background Opacity and Window Blur (partial) - #12470

Closed
nwparker wants to merge 1 commit into
mainfrom
fix/macos-window-blur-surface
Closed

nwparker wants to merge 1 commit into
mainfrom
fix/macos-window-blur-surface

Conversation

@nwparker

@nwparker nwparker commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

macOS configured no vibrancy surface at all, and an opaque fill sat between the desktop and the terminal, so Background Opacity and Window Blur both looked like no-ops.

Fix

Adds a platform-gated blur surface (resolveMainWindowBlurSurface, covering macOS vibrancy / Windows acrylic / Linux fallback) and a root class that drops the opaque fill so the opacity token reaches the compositor.

Warning

This does not close #8797 — it is deliberately Refs, not Fixes.
I measured it on macOS with a dedicated isolated profile, identical app state, same wallpaper and window geometry, native screencapture, toggling only windowBackgroundBlur with a restart between runs:

Region Blur OFF Blur ON Mean abs diff
Terminal pane RGB(48.0, 53.0, 61.0) RGB(50.0, 55.0, 63.1) 2.0 / 255
Sidebar RGB(46.3, 46.4, 46.4) RGB(46.3, 46.4, 46.4) 0 — pixel-identical

The renderer half provably works (window-blur class applied; html/body/#root compute to rgba(0,0,0,0); .xterm at rgba(40,44,52,0.55)), but the native vibrancy never reaches the screen, so the setting is still not visibly effective. Most likely Electron keeps an opaque window backing without transparent: true, which #8482 removed on purpose.

Kept because it is a correct, unit-tested prerequisite. Merge or hold at your discretion — one machine, one macOS version, external display.

Verification

  • pnpm typecheck clean on this branch
  • This branch's own tests pass; the new cases fail before the change and pass after
  • Split out of the original combined branch; the union of all 12 split branches was diffed back against it to prove nothing was lost

Refs #8797

Made with Orca 🐋

…ndow Blur (partial)

macOS configured no vibrancy surface at all, and an opaque fill sat between the desktop and the terminal, so Background Opacity and Window Blur both looked like no-ops.

Adds a platform-gated blur surface (`resolveMainWindowBlurSurface`, covering macOS vibrancy / Windows acrylic / Linux fallback) and a root class that drops the opaque fill so the opacity token reaches the compositor.

> [!WARNING]
> **This does not close #8797 — it is deliberately `Refs`, not `Fixes`.**
> I measured it on macOS with a dedicated isolated profile, identical app state, same wallpaper and window geometry, native `screencapture`, toggling only `windowBackgroundBlur` with a restart between runs:
>
> | Region | Blur OFF | Blur ON | Mean abs diff |
> | --- | --- | --- | --- |
> | Terminal pane | RGB(48.0, 53.0, 61.0) | RGB(50.0, 55.0, 63.1) | 2.0 / 255 |
> | Sidebar | RGB(46.3, 46.4, 46.4) | RGB(46.3, 46.4, 46.4) | 0 — pixel-identical |
>
> The renderer half provably works (`window-blur` class applied; `html`/`body`/`#root` compute to `rgba(0,0,0,0)`; `.xterm` at `rgba(40,44,52,0.55)`), but the native vibrancy never reaches the screen, so the setting is still not visibly effective. Most likely Electron keeps an opaque window backing without `transparent: true`, which #8482 removed on purpose.
>
> Kept because it is a correct, unit-tested prerequisite. Merge or hold at your discretion — one machine, one macOS version, external display.

Refs #8797

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nwparker, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b11878b-2619-4c6d-b5d0-1b609442829b

📥 Commits

Reviewing files that changed from the base of the PR and between c498d2d and 3d91f6c.

📒 Files selected for processing (8)
  • src/main/window/createMainWindow.test.ts
  • src/main/window/createMainWindow.ts
  • src/main/window/main-window-blur-surface.test.ts
  • src/main/window/main-window-blur-surface.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/assets/main.css
  • src/renderer/src/lib/window-blur-root-class.test.ts
  • src/renderer/src/lib/window-blur-root-class.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker

nwparker commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Visual proof — and why this is Refs, not Fixes

I built the before/after for this fix and the measurement contradicted it. Reporting that rather than attaching a screenshot that merely looks convincing.

Method. A dedicated Orca instance on an isolated profile (ORCA_DEV_USER_DATA_PATH) so nothing touched real workspaces. Scratch git repo, one workspace, one terminal — identical app state in both runs, same desktop wallpaper, same window geometry, native screencapture (a CDP screenshot cannot show window vibrancy; it is a compositor effect). Only windowBackgroundBlur differs, with a full restart between runs because vibrancy is a window-creation option.

8797-blur-comparison.png

Region Blur OFF Blur ON Mean abs diff
Terminal pane RGB(48.0, 53.0, 61.0) RGB(50.0, 55.0, 63.1) 2.0 / 255
Sidebar RGB(46.3, 46.4, 46.4) RGB(46.3, 46.4, 46.4) 0 — pixel-identical

The renderer half provably works — with blur on, documentElement carries window-blur, html/body/#root compute to rgba(0,0,0,0), and .xterm is rgba(40, 44, 52, 0.55). But the native vibrancy never reaches the screen, so the user-visible result is still "no effect" — exactly what #8797 reports.

Most likely cause: Electron keeps an opaque backing on the BrowserWindow unless transparent: true, which #8482 removed deliberately for a compositing-cost reason. Dropping backgroundColor is necessary but not sufficient, and resolving that tradeoff is bigger than a bug-bash change.

So #8797 stays open. The code here is a correct, unit-tested prerequisite (resolveMainWindowBlurSurface covers macOS vibrancy / Windows acrylic / Linux fallback and the dark/light fill) — merge or hold at your discretion.

Warning

One machine, one macOS version, external display. Worth a second pair of eyes before concluding the approach is a dead end.

@nwparker

nwparker commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Pausing merge pending performance validation.

This changes a known GPU/compositor-sensitive path: macOS vibrancy: 'under-window' with visualEffectState: 'active', Windows acrylic, and a transparent renderer root. The prior #8482 reproduction measured multi-watt GPU usage with visible blur/transparent composition, with roughly an 85–89% reduction when blur or window visibility was removed.

This PR correctly avoids transparent: true, so it may avoid that specific regression, but it makes the native material visible and currently has no GPU/power or frame-gap A/B evidence. Before merging, please compare packaged blur-on/off builds on macOS and Windows during idle, terminal output, resize, and tab switching. Also cover the pending-restart mismatch (the renderer class changes live while native options apply only after relaunch) and the Linux no-material path.

This is a hold for evidence, not a rejection of the direction.

@innocarpe

Copy link
Copy Markdown
Contributor

Heads-up from a Windows report on #8797: current main already sets acrylic when blur is on, but the opaque fill + renderer root still cover it.

I narrowed #10349 to that Windows half only (transparent fill + desktop root clear; no macOS vibrancy). Leaving the macOS GPU/material question here.

@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #36580, which adds Opaque, Translucent and Blurred window materials on macOS, Windows and Linux (plus Reduce Visual Effects) and fixes the transparent-terminal flicker. Thank you for this PR, it shaped the design.

@nwparker nwparker closed this Nov 2, 2026
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.

[Bug]: "Background Opacity" and "Window Blur" have no visible effect on macOS

2 participants