@@ -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
@@ -6590,6 +6592,7 @@ final class GhosttySurfaceScrollView: NSView {
65906592 private static let scrollToBottomThreshold : CGFloat = 5.0
65916593 private var isActive = true
65926594 private var lastFocusRefreshAt : CFTimeInterval = 0
6595+ private var lastRequestedPortalOcclusionVisible : Bool ?
65936596 private var activeDropZone : DropZone ?
65946597 private var pendingDropZone : DropZone ?
65956598 private var dropZoneOverlayAnimationGeneration : UInt64 = 0
@@ -7909,6 +7912,10 @@ final class GhosttySurfaceScrollView: NSView {
79097912 let wasVisible = surfaceView. isVisibleInUI
79107913 surfaceView. setVisibleInUI ( visible)
79117914 isHidden = !visible
7915+ if wasVisible != visible, lastRequestedPortalOcclusionVisible != visible {
7916+ lastRequestedPortalOcclusionVisible = visible
7917+ surfaceView. terminalSurface? . setOcclusion ( visible)
7918+ }
79127919#if DEBUG
79137920 if wasVisible != visible {
79147921 let transition = " \( wasVisible ? 1 : 0 ) -> \( visible ? 1 : 0 ) "
0 commit comments