Merge origin/main into pr-ssh-stack-main
This commit is contained in:
commit
93bc5ea78b
3 changed files with 123 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue