diff --git a/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift b/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift index db712ca3d..e9f49a769 100644 --- a/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift +++ b/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift @@ -48,6 +48,10 @@ extension Ghostty { /// True when the surface should show a highlight effect (e.g., when presented via goto_split). @Published private(set) var highlighted: Bool = false + var surface: ghostty_surface_t? { + nil + } + init(id: UUID?, frame: CGRect) { self.id = id ?? UUID() super.init(frame: frame) diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift index 75356ceed..726892e18 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift @@ -164,7 +164,7 @@ extension Ghostty { private(set) var surfaceModel: Ghostty.Surface? /// Returns the underlying C value for the surface. See "note" on surfaceModel. - var surface: ghostty_surface_t? { + override var surface: ghostty_surface_t? { surfaceModel?.unsafeCValue } /// Current scrollbar state, cached here for persistence across rebuilds diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift index 81981f7fb..3b5034a0e 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift @@ -14,7 +14,11 @@ extension Ghostty { // The current search state. When non-nil, the search overlay should be shown. @Published var searchState: SearchState? - private(set) var surface: ghostty_surface_t? + private(set) var _surface: ghostty_surface_t? + + override var surface: ghostty_surface_t? { + _surface + } init(_ app: ghostty_app_t, baseConfig: SurfaceConfiguration? = nil, uuid: UUID? = nil) { @@ -32,7 +36,7 @@ extension Ghostty { // TODO return } - self.surface = surface + self._surface = surface } required init?(coder: NSCoder) {