mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-14 18:01:58 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user