@@ -4015,7 +4015,9 @@ class GhosttyNSView: NSView, NSUserInterfaceValidations {
40154015 return true
40164016 }
40174017
4018- // Visibility is used for focus gating, not for libghostty occlusion.
4018+ // Visibility is used for focus gating. Explicit portal visibility transitions
4019+ // also drive Ghostty occlusion so hidden workspace/split surfaces pause and
4020+ // queue a redraw when they become visible again.
40194021 fileprivate var isVisibleInUI : Bool { visibleInUI }
40204022 fileprivate func setVisibleInUI( _ visible: Bool ) {
40214023 visibleInUI = visible
@@ -6604,6 +6606,7 @@ final class GhosttySurfaceScrollView: NSView {
66046606 private static let scrollToBottomThreshold : CGFloat = 5.0
66056607 private var isActive = true
66066608 private var lastFocusRefreshAt : CFTimeInterval = 0
6609+ private var lastRequestedPortalOcclusionVisible : Bool ?
66076610 private var activeDropZone : DropZone ?
66086611 private var pendingDropZone : DropZone ?
66096612 private var dropZoneOverlayAnimationGeneration : UInt64 = 0
@@ -7942,6 +7945,10 @@ final class GhosttySurfaceScrollView: NSView {
79427945 let wasVisible = surfaceView. isVisibleInUI
79437946 surfaceView. setVisibleInUI ( visible)
79447947 isHidden = !visible
7948+ if wasVisible != visible, lastRequestedPortalOcclusionVisible != visible {
7949+ lastRequestedPortalOcclusionVisible = visible
7950+ surfaceView. terminalSurface? . setOcclusion ( visible)
7951+ }
79457952#if DEBUG
79467953 if wasVisible != visible {
79477954 let transition = " \( wasVisible ? 1 : 0 ) -> \( visible ? 1 : 0 ) "
0 commit comments