Skip to content

Use a stock NSVisualEffectView for the macOS window backdrop - #444

Merged
Tryanks merged 2 commits into
mainfrom
macos-27-sidebar-material
Sep 16, 2026
Merged

Tryanks merged 2 commits into
mainfrom
macos-27-sidebar-material

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Behaviour

On macOS 27 the sidebar and window edges rendered with no blur: whatever sat behind the window showed through pin-sharp under the theme's 78% canvas.

GPUI's WindowBackgroundAppearance::Blurred inserts an NSVisualEffectView with the .selection material and strips its tint layers so only the Gaussian blur remains. On macOS 27 .selection carries no CABackdropLayer at all, so after the stripping the view paints nothing. Tracked with the layer dumps in #445, which waits on an upstream GPUI fix.

This PR stops relying on that path on macOS:

  • The main window opens Transparent; run_shell slides a stock NSVisualEffectView (.sidebar, behind-window, follows window active state) under the GPUI view (crates/ui/src/macos_backdrop.rs). The material is left as AppKit builds it, so it follows Reduce Transparency and the macOS 27 Liquid Glass slider.
  • The material's appearance is pinned to the theme mode in theme::change_mode, so a forced dark palette never sits on a light material.
  • material::canvas returns transparent when the system material is installed, so the theme tint and the system tint do not stack. Overlay root and desktop chat root use it. Windows keeps the translucent canvas over Acrylic, which carries no tint of its own.
  • raw-window-handle, objc2, objc2-app-kit become non-optional in tcode-ui (the backdrop is not a desktop-feature capability); the AppKit feature list gains NSVisualEffectView, NSView, NSWindow, NSAppearance, NSGraphics, NSResponder.
  • docs/DESIGN.md Window material section and the T0 row describe the new composition.

Trade-off: the T0 tone is now the system's neutral gray rather than the theme's #F2F4F7; the strength is the user's, via the system slider.

Evidence

  • cargo fmt --all --check, cargo clippy -p tcode-ui -p tcode --all-targets -- -D warnings: clean.
  • cargo test -p tcode-ui -p tcode: 415 passed, 0 failed.
  • Manual on macOS 27.0 (26A428): old build shows the window behind the sidebar sharp; this build shows a frosted sidebar with only soft colour bleeding through.
  • Not run locally: cargo machete (not installed), iOS/Android/Web builds. raw-window-handle builds on wasm with std; relying on CI for those.

GPUI's WindowBackgroundAppearance::Blurred strips the material's tint
layers and relies on NSVisualEffectMaterial.selection for the blur. On
macOS 27 that material carries no CABackdropLayer, so the window renders
no blur and the sidebar reads as over-transparent (#445).

Open a Transparent window instead and slide a .sidebar NSVisualEffectView
under the GPUI view, left exactly as AppKit builds it: it blurs on every
release, follows the window's active state, honours Reduce Transparency
and the macOS 27 Liquid Glass slider, and is pinned to the theme mode so a
forced dark palette never sits on a light material. The theme canvas is
transparent on macOS so the two tints do not stack; Windows keeps the
translucent canvas over Acrylic, which carries no tint of its own.
@Tryanks
Tryanks force-pushed the macos-27-sidebar-material branch from bf300f3 to 2689514 Compare September 16, 2026 07:12
@Tryanks
Tryanks merged commit 26ade86 into main Sep 16, 2026
6 checks passed
@Tryanks
Tryanks deleted the macos-27-sidebar-material branch September 16, 2026 07:35
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.

1 participant