macos: fix an incorrect bindable write during view update

This commit is contained in:
Mitchell Hashimoto
2025-06-06 12:12:14 -07:00
parent b044f4864a
commit 3e02c0cbd5

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