macOS: fix flickering when creating new tab with glass style (#14121)

A regression from #13985.


https://github.com/user-attachments/assets/cc7d76d7-7d86-4566-921c-a6531ce4087d




### AI Disclosure

Used Claude to investigate, I reviewed and tested.
This commit is contained in:
Mitchell Hashimoto
2026-09-02 08:09:41 -07:00
committed by GitHub

View File

@@ -78,7 +78,14 @@ class TerminalViewContainer: NSView {
let newValue = DerivedConfig(config: config, preferredBackgroundColor: preferredBackgroundColor, cornerRadius: windowCornerRadius)
guard newValue != derivedConfig else { return }
derivedConfig = newValue
DispatchQueue.main.async(execute: updateGlassEffectIfNeeded)
// Attach the glass effect synchronously if missing to prevent flicker when a new tab appears.
// Existing updates remain deferred, as they can occur during SwiftUI rendering.
if glassEffectView == nil {
updateGlassEffectIfNeeded()
} else {
DispatchQueue.main.async(execute: updateGlassEffectIfNeeded)
}
}
}