gpui_macos: Fix window blur on macOS 26+ by using UnderWindowBackground - #62605
Open
neo773 wants to merge 1 commit into
Open
gpui_macos: Fix window blur on macOS 26+ by using UnderWindowBackground#62605neo773 wants to merge 1 commit into
neo773 wants to merge 1 commit into
Conversation
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.
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WindowBackgroundAppearance::Blurredrenders with no blur on macOS 26 and 27.BlurredViewis anNSVisualEffectViewset toNSVisualEffectMaterial::Selection, andblurred_view_update_layerwalks the resulting layer tree to strip the material's own backgrounds and itscolorSaturatefilter.On macOS 26+,
Selectionno longer vends aCABackdropLayer— so there is nothing to walk, and nothing to blur.Evidence
Probed on macOS 27.0, reading the live layer tree of the
BlurredViewin a running GPUI app configured withWindowBackgroundAppearance::Blurred:No
CABackdropLayer, and no filters forremove_layer_backgroundto find. On macOS 25 and earlier the same view carries a backdrop sublayer plus theBlurandcolorSaturatefilters 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::BehindWindowexplicitly. 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_backgroundis 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: