fix(macos): defer isOverflowing mutation to break SwiftUI render loop… · openclaw/openclaw@fd4f5b3
liuhao1024
·
2026-06-14
·
via Recent Commits to openclaw:main
File tree
apps/macos/Sources/OpenClaw
| Original file line number | Diff line number | Diff line change |
|---|
@@ -92,7 +92,13 @@ extension VoiceWakeOverlayController {
|
92 | 92 | |
93 | 93 | let contentHeight = ceil(used.height + (textInset.height * 2)) |
94 | 94 | let total = contentHeight + self.verticalPadding * 2 |
95 | | -self.model.isOverflowing = total > self.maxHeight |
| 95 | + // Defer the overflow state mutation to break the SwiftUI onChange → measuredHeight → |
| 96 | + // isOverflowing → re-render → onChange synchronous render loop (fixes #43480). |
| 97 | +let overflowing = total > self.maxHeight |
| 98 | +DispatchQueue.main.async { [weak self] in |
| 99 | +guard let self, self.model.isOverflowing != overflowing else { return } |
| 100 | +self.model.isOverflowing = overflowing |
| 101 | +} |
96 | 102 | return max(self.minHeight, min(total, self.maxHeight)) |
97 | 103 | } |
98 | 104 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。