mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-05-04 15:28:37 +03:00
17 lines
417 B
Swift
17 lines
417 B
Swift
import SwiftUI
|
|
|
|
/// Allows accessing the window that this view is a part of.
|
|
struct WindowAccessor: NSViewRepresentable {
|
|
@Binding var window: NSWindow?
|
|
|
|
func makeNSView(context: Context) -> NSView {
|
|
let view = NSView()
|
|
DispatchQueue.main.async {
|
|
self.window = view.window
|
|
}
|
|
return view
|
|
}
|
|
|
|
func updateNSView(_ nsView: NSView, context: Context) {}
|
|
}
|