Ariver
2026-06-12 ea8c934ef857ce7fafb109f60c579a33f5b6bd21
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
26
27
28
29
30
31
32
33
34
35
36
37
38
import AppKit
import AlignerCore
 
@MainActor
final class OverlayWindowController {
    private let host: any OverlayHostProtocol
    private(set) var isVisible = false
 
    init(host: any OverlayHostProtocol) {
        self.host = host
    }
 
    var currentLevel: CGWindowLevel {
        host.currentLevel
    }
 
    func show(context: OverlayContext) {
        host.show(context: context)
        isVisible = true
    }
 
    func hide(reason: DismissReason) {
        host.hide(reason: reason)
        isVisible = false
    }
 
    func promoteForTextInput(allowAppActivation: Bool) {
        host.promoteForTextInput(allowAppActivation: allowAppActivation)
    }
 
    func attachChild(_ window: NSWindow) {
        host.attachChild(window)
    }
 
    func detachChild(_ window: NSWindow) {
        host.detachChild(window)
    }
}