Ariver
2026-06-10 fe5c1fa0d397938511e6102bbe5562f03f02607f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import Foundation
import AlignerCore
 
final class DebugWindowCloseService: WindowCloseServiceProtocol {
    private(set) var closedWindowIDs: [UInt32] = []
    private(set) var closedAppProcessIdentifiers: [Int32] = []
 
    func close(window: AlignerWindow) throws -> WindowCloseResult {
        closedWindowIDs.append(window.id)
        if ProcessInfo.processInfo.environment["ALIGNER_DEBUG_WINDOW_CLOSE_RESULT"] == "windowNotFound" {
            return .windowNotFound
        }
        return .requested
    }
 
    func close(app: AlignerApp) throws -> WindowCloseResult {
        if let processIdentifier = app.processIdentifier {
            closedAppProcessIdentifiers.append(processIdentifier)
        }
        if ProcessInfo.processInfo.environment["ALIGNER_DEBUG_WINDOW_CLOSE_RESULT"] == "windowNotFound" {
            return .windowNotFound
        }
        return .requested
    }
}