macos: fix an incorrect bindable write during view update

pull/7535/head
Mitchell Hashimoto 2025-06-06 12:12:14 -07:00
parent b044f4864a
commit 3e02c0cbd5
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 6 additions and 2 deletions

View File

@ -301,8 +301,12 @@ extension Ghostty {
if let instant = focusInstant {
let d = instant.duration(to: ContinuousClock.now)
if (d < .milliseconds(500)) {
// Avoid this size completely.
lastSize = geoSize
// Avoid this size completely. We can't set values during
// view updates so we have to defer this to another tick.
DispatchQueue.main.async {
lastSize = geoSize
}
return true;
}
}