macOS: fix flickering when creating new tab with glass style

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-09-02 16:11:07 +02:00
parent 3c1ef5b32f
commit aafacb1cb9

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)
}
}
}