native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix canvas exit terminal occlusion recovery

onevcat 32f51451 306f618e

+37
+10
supacode/Infrastructure/Ghostty/GhosttySurfaceView.swift
··· 882 882 } 883 883 884 884 func updateSurfaceSize() { 885 + resumeDeferredOcclusionIfNeeded() 885 886 guard let surface else { return } 886 887 // When pinnedSize is set (canvas mode), convertToBacking() includes the 887 888 // .scaleEffect() layer transform, producing scale-dependent backing sizes. ··· 1044 1045 1045 1046 func handleAttachmentChangeForTesting() { 1046 1047 handleAttachmentChange() 1048 + } 1049 + 1050 + func resumeDeferredOcclusionIfNeededForTesting() { 1051 + resumeDeferredOcclusionIfNeeded() 1052 + } 1053 + 1054 + private func resumeDeferredOcclusionIfNeeded() { 1055 + guard isReadyToApplyOcclusion else { return } 1056 + reapplyOcclusionIfNeeded() 1047 1057 } 1048 1058 1049 1059 private func reapplyOcclusionIfNeeded() {
+27
supacodeTests/GhosttySurfaceViewTests.swift
··· 154 154 #expect(appliedValues == [true, false]) 155 155 } 156 156 157 + @Test func occlusionCanRecoverWhenAttachmentCallbackIsMissedAfterReattachment() async { 158 + let runtime = GhosttyRuntime() 159 + let surfaceView = GhosttySurfaceView( 160 + runtime: runtime, 161 + workingDirectory: nil, 162 + context: GHOSTTY_SURFACE_CONTEXT_TAB, 163 + skipsSurfaceCreationForTesting: true 164 + ) 165 + var appliedValues: [Bool] = [] 166 + surfaceView.onOcclusionAppliedForTesting = { appliedValues.append($0) } 167 + var attachmentState = (hasSuperview: true, hasWindow: true) 168 + surfaceView.attachmentStateForTesting = { attachmentState } 169 + 170 + surfaceView.setOcclusion(true) 171 + await drainMainQueue() 172 + #expect(appliedValues == [true]) 173 + 174 + attachmentState = (hasSuperview: false, hasWindow: false) 175 + surfaceView.handleAttachmentChangeForTesting() 176 + await drainMainQueue() 177 + 178 + attachmentState = (hasSuperview: true, hasWindow: true) 179 + surfaceView.resumeDeferredOcclusionIfNeededForTesting() 180 + await drainMainQueue() 181 + #expect(appliedValues == [true, true]) 182 + } 183 + 157 184 private func drainMainQueue() async { 158 185 await withCheckedContinuation { continuation in 159 186 DispatchQueue.main.async {