Merge origin/main into pr-ssh-stack-main

This commit is contained in:
Lawrence Chen 2026-03-17 00:40:39 -07:00
commit 93bc5ea78b
No known key found for this signature in database
3 changed files with 123 additions and 9 deletions

View file

@ -8662,6 +8662,23 @@ struct GhosttyTerminalView: NSViewRepresentable {
return !hostedViewHasSuperview
}
private static func synchronizePortalGeometry(
for host: HostContainerView,
coordinator: Coordinator
) {
let geometryRevision = host.geometryRevision
guard coordinator.lastSynchronizedHostGeometryRevision != geometryRevision else { return }
coordinator.lastSynchronizedHostGeometryRevision = geometryRevision
if host.inLiveResize || host.window?.inLiveResize == true {
TerminalWindowPortalRegistry.synchronizeForAnchor(host)
return
}
// Avoid synchronizing the terminal portal while AppKit is still inside
// the current layout turn. Re-entrant syncs here can wedge window resize
// handling and leave the app spinning on the wait cursor.
TerminalWindowPortalRegistry.scheduleExternalGeometrySynchronizeForAllWindows()
}
func makeNSView(context: Context) -> NSView {
let container = HostContainerView()
container.wantsLayer = false
@ -8829,8 +8846,10 @@ struct GhosttyTerminalView: NSViewRepresentable {
hostedView.setActive(coordinator.desiredIsActive)
hostedView.setNotificationRing(visible: coordinator.desiredShowsUnreadNotificationRing)
}
TerminalWindowPortalRegistry.synchronizeForAnchor(host)
coordinator.lastSynchronizedHostGeometryRevision = host.geometryRevision
Self.synchronizePortalGeometry(
for: host,
coordinator: coordinator
)
}
if host.window != nil, hostOwnsPortalNow {
@ -8866,8 +8885,10 @@ struct GhosttyTerminalView: NSViewRepresentable {
coordinator.lastBoundHostId = hostId
coordinator.lastSynchronizedHostGeometryRevision = geometryRevision
} else if portalBindingLive && coordinator.lastSynchronizedHostGeometryRevision != geometryRevision {
TerminalWindowPortalRegistry.synchronizeForAnchor(host)
coordinator.lastSynchronizedHostGeometryRevision = geometryRevision
Self.synchronizePortalGeometry(
for: host,
coordinator: coordinator
)
}
} else if hostOwnsPortalNow, portalBindingStillLive() {
// Bind is deferred until host moves into a window. Update the