mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-01 15:38:35 +00:00
apprt/embedded: hook up paste confirmation
This commit is contained in:
@@ -6,9 +6,15 @@ import GhosttyKit
|
||||
class PasteProtectionController: NSWindowController {
|
||||
override var windowNibName: NSNib.Name? { "PasteProtection" }
|
||||
|
||||
let surface: ghostty_surface_t
|
||||
let contents: String
|
||||
let state: UnsafeMutableRawPointer?
|
||||
weak private var delegate: PasteProtectionViewDelegate? = nil
|
||||
|
||||
init(delegate: PasteProtectionViewDelegate) {
|
||||
init(surface: ghostty_surface_t, contents: String, state: UnsafeMutableRawPointer?, delegate: PasteProtectionViewDelegate) {
|
||||
self.surface = surface
|
||||
self.contents = contents
|
||||
self.state = state
|
||||
self.delegate = delegate
|
||||
super.init(window: nil)
|
||||
}
|
||||
@@ -22,7 +28,7 @@ class PasteProtectionController: NSWindowController {
|
||||
override func windowDidLoad() {
|
||||
guard let window = window else { return }
|
||||
window.contentView = NSHostingView(rootView: PasteProtectionView(
|
||||
contents: "Hello\nWorld",
|
||||
contents: contents,
|
||||
delegate: delegate
|
||||
))
|
||||
}
|
||||
|
Reference in New Issue
Block a user