macOS: move surface to OSSurfaceView

This commit is contained in:
Lukas
2026-04-12 12:17:33 +02:00
parent 1665755a93
commit a541e23120
3 changed files with 11 additions and 3 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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) {