Skip to content

Use NSGlassEffectView directly behind availability guards#120

Open
arzafran wants to merge 2 commits into
mainfrom
refactor/liquid-glass-available-modernization
Open

Use NSGlassEffectView directly behind availability guards#120
arzafran wants to merge 2 commits into
mainfrom
refactor/liquid-glass-available-modernization

Conversation

@arzafran

Copy link
Copy Markdown
Member

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

  • WindowGlassEffect rewritten: direct NSGlassEffectView under #if compiler(>=6.2) + @available(macOS 26.0, *) (same pattern the ghostty submodule uses), public tintColor/cornerRadius instead of perform(NSSelectorFromString("setTintColor:"))
  • Fixes the as? NSVisualEffectView.Type cast bug — NSGlassEffectView subclasses NSView, so the cast always failed and window glass never activated
  • New WindowGlassEffect.isGlassEffectView(_:) helper replaces className == "NSGlassEffectView" string checks in both window portals
  • SidebarVisualEffectBackground modernized the same way
  • CI + release "Select Xcode" steps prefer the newest Xcode_26*.app, falling back to the image default if absent

Heads 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

  • Debug build compiles with Xcode 26.3 (BUILD SUCCEEDED)
  • No remaining NSClassFromString("NSGlassEffectView") / setTintColor: in Sources/
  • Workflow YAML parses
  • CI green with Xcode 26 toolchain
  • Visual check of window + sidebar glass on macOS 26 (tagged Debug build)

arzafran added 2 commits July 10, 2026 15:45
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.
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