Commit 55757f1
Fix browser freeze after pane split by reattaching WKWebView rendering state (manaflow-ai#1852)
When a pane split occurs, SwiftUI recreates host views and the portal
system rebinds the WKWebView to a new container. However, the bind path
never called BrowserWindowPortalRegistry.refresh(), so WebKit's internal
rendering state (_exitInWindow/_enterInWindow) was never cycled. This
left the WKWebView frozen in the original pane after a split.
Add refresh() calls after every portal bind that changes the host, in
three code paths: the main update path (shouldBindNow), onDidMoveToWindow,
and onGeometryChanged. The refresh is a no-op when no reattach is needed
(browserPortalNeedsRenderingStateReattach == false), so normal rendering
is unaffected.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 7bf2fe0 commit 55757f1
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6098 | 6098 | | |
6099 | 6099 | | |
6100 | 6100 | | |
| 6101 | + | |
| 6102 | + | |
| 6103 | + | |
| 6104 | + | |
6101 | 6105 | | |
6102 | 6106 | | |
6103 | 6107 | | |
| |||
6129 | 6133 | | |
6130 | 6134 | | |
6131 | 6135 | | |
| 6136 | + | |
| 6137 | + | |
| 6138 | + | |
| 6139 | + | |
6132 | 6140 | | |
6133 | 6141 | | |
6134 | 6142 | | |
| |||
6166 | 6174 | | |
6167 | 6175 | | |
6168 | 6176 | | |
| 6177 | + | |
| 6178 | + | |
| 6179 | + | |
| 6180 | + | |
| 6181 | + | |
| 6182 | + | |
| 6183 | + | |
| 6184 | + | |
6169 | 6185 | | |
6170 | 6186 | | |
6171 | 6187 | | |
| |||
0 commit comments