From 082aef6a53fbc5bdd48f45cfa6a273f1332bbf49 Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:40:10 -0800 Subject: [PATCH] Skip background glass effect on macOS 26 to fix blank window The transparency setup (non-opaque window + clear subview backgrounds) required for the glass effect breaks SwiftUI content rendering on macOS 26. Disable background glass when NSGlassEffectView is available until a proper macOS 26 implementation is found. --- Sources/ContentView.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index 56a2c62b..a1001b1b 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -360,23 +360,22 @@ struct ContentView: View { window.identifier = NSUserInterfaceItemIdentifier("cmux.main") window.titlebarAppearsTransparent = true window.styleMask.insert(.fullSizeContentView) - // For behindWindow blur to work, window must be non-opaque with transparent content view - if sidebarBlendMode == SidebarBlendModeOption.behindWindow.rawValue && bgGlassEnabled { + // Background glass: skip on macOS 26+ where NSGlassEffectView causes blank SwiftUI content. + // The transparency setup (non-opaque window + clear subview backgrounds) breaks rendering. + if sidebarBlendMode == SidebarBlendModeOption.behindWindow.rawValue && bgGlassEnabled + && !WindowGlassEffect.isAvailable { window.isOpaque = false window.backgroundColor = .clear - // Configure contentView and all subviews for transparency if let contentView = window.contentView { contentView.wantsLayer = true contentView.layer?.backgroundColor = NSColor.clear.cgColor contentView.layer?.isOpaque = false - // Make SwiftUI hosting view transparent for subview in contentView.subviews { subview.wantsLayer = true subview.layer?.backgroundColor = NSColor.clear.cgColor subview.layer?.isOpaque = false } } - // Apply liquid glass effect to the window with tint from settings let tintColor = (NSColor(hex: bgGlassTintHex) ?? .black).withAlphaComponent(bgGlassTintOpacity) WindowGlassEffect.apply(to: window, tintColor: tintColor) }