Skip to content

gpui_macos: Fix window blur on macOS 26+ by using UnderWindowBackground - #62605

Open
neo773 wants to merge 1 commit into
zed-industries:mainfrom
neo773:gpui-macos27-blur-material
Open

gpui_macos: Fix window blur on macOS 26+ by using UnderWindowBackground#62605
neo773 wants to merge 1 commit into
zed-industries:mainfrom
neo773:gpui-macos27-blur-material

Conversation

@neo773

@neo773 neo773 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

WindowBackgroundAppearance::Blurred renders with no blur on macOS 26 and 27.

BlurredView is an NSVisualEffectView set to NSVisualEffectMaterial::Selection, and blurred_view_update_layer walks the resulting layer tree to strip the material's own backgrounds and its colorSaturate filter.

On macOS 26+, Selection no longer vends a CABackdropLayer — so there is nothing to walk, and nothing to blur.

Evidence

Probed on macOS 27.0, reading the live layer tree of the BlurredView in a running GPUI app configured with WindowBackgroundAppearance::Blurred:

layer    = NSViewBackingLayer
filters  = 0
sublayers = 1  → ["CALayer"]

No CABackdropLayer, and no filters for remove_layer_background to find. On macOS 25 and earlier the same view carries a backdrop sublayer plus the Blur and colorSaturate filters that code is written against.

Fix

Use NSVisualEffectMaterial::UnderWindowBackground, which still vends a backdrop on macOS 26+ and is the material AppKit documents for the area behind a window's own background.

Also state NSVisualEffectBlendingMode::BehindWindow explicitly. It is already the default, but sampling the desktop rather than the window's own content is this view's entire purpose, and leaving it implicit makes the view's behaviour depend on a default that has now changed once.

remove_layer_background is untouched and still applies to the new material's layer tree.

Verification

Built and run on macOS 27.0 against a GPUI application using WindowBackgroundAppearance::Blurred — solid/unblurred window before, blur restored after. macOS 25 and earlier are unaffected in the same build.

Release Notes:

  • Fixed blurred window backgrounds rendering unblurred on macOS 26 and later.

WindowBackgroundAppearance::Blurred renders with no blur on macOS 26 and 27.

BlurredView is an NSVisualEffectView set to NSVisualEffectMaterial::Selection,
and blurred_view_update_layer walks the resulting layer tree to strip the
material's own backgrounds and its colorSaturate filter. On macOS 26+ Selection
no longer vends a CABackdropLayer, so there is nothing to walk and nothing to
blur: probed on 27.0, the effect view's layer has zero filters and a single
plain CALayer sublayer.

UnderWindowBackground still vends a backdrop, and is the material AppKit
documents for the area behind a window's own background. Also state the
behind-window blending mode rather than inheriting it - it is already the
default, but sampling the desktop instead of the window's own content is the
entire purpose of this view.

Verified on macOS 27.0 against a GPUI application using
WindowBackgroundAppearance::Blurred: solid window before, blur restored after.

Release Notes:

- Fixed blurred window backgrounds rendering unblurred on macOS 26 and later.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 13, 2026
@dinocosta dinocosta added the area:gpui GPUI rendering framework support label Aug 14, 2026
@dinocosta

Copy link
Copy Markdown
Member

Hey @neo773 ! Thank you for suggesting these changes 🙂

Before we have someone review it, would you be able attach screenshots from a simple GPUI example showing the before and after? As stated in our Contributing Guide, any UI change should have screenshots or screen recordings attached.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpui GPUI rendering framework support cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants