Use NSGlassEffectView directly behind availability guards#120
Open
arzafran wants to merge 2 commits into
Open
Conversation
Replace NSClassFromString lookups and the private setTintColor: selector with compile-time NSGlassEffectView usage under #if compiler(>=6.2) + @available(macOS 26.0, *), matching the pattern the ghostty submodule already uses. This also fixes window-level Liquid Glass never activating: the old code cast NSGlassEffectView to NSVisualEffectView.Type, which fails at runtime because NSGlassEffectView subclasses NSView, so the fallback path always ran even on macOS 26.
CI and release currently pick the image-default Xcode 16.4 (macOS 15 SDK), which compiles the new glass path out of shipped builds. Prefer the newest Xcode 26 install when present, falling back to the image default, so release builds link against the macOS 26 SDK and Liquid Glass reaches users.
3 tasks
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.
What this does
Liquid glass in the app now actually uses Apple's real glass API everywhere it can. Window-level glass was silently broken: a bad type cast meant the old blur fallback always ran, even on macOS 26. That's fixed, and all the stringly-typed runtime lookups and private selector calls are replaced with the real, compile-checked API.
It also switches CI and release builds to Xcode 26. Until now shipped builds were compiled with Xcode 16.4 against the macOS 15 SDK, so users could never get liquid glass at all, regardless of the code.
Summary
WindowGlassEffectrewritten: directNSGlassEffectViewunder#if compiler(>=6.2)+@available(macOS 26.0, *)(same pattern the ghostty submodule uses), publictintColor/cornerRadiusinstead ofperform(NSSelectorFromString("setTintColor:"))as? NSVisualEffectView.Typecast bug —NSGlassEffectViewsubclassesNSView, so the cast always failed and window glass never activatedWindowGlassEffect.isGlassEffectView(_:)helper replacesclassName == "NSGlassEffectView"string checks in both window portalsSidebarVisualEffectBackgroundmodernized the same wayXcode_26*.app, falling back to the image default if absentHeads up before merging
Linking against the macOS 26 SDK opts the whole app into Tahoe's Liquid Glass design language (window chrome, menus, controls), not just our explicit glass views. Since main auto-ships on green CI, merging this changes the shipped app's appearance on macOS 26 immediately. Worth a visual pass on the release build before landing.
Test Plan
BUILD SUCCEEDED)NSClassFromString("NSGlassEffectView")/setTintColor:in Sources/