From d38301bb9ff4a3bf52dca046f0dc75d50a43d244 Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Sun, 12 Apr 2026 11:58:04 +0200 Subject: [PATCH] macOS: move `cellSize` to `OSSurfaceView` --- macos/Sources/Ghostty/Surface View/OSSurfaceView.swift | 6 ++++++ macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift | 6 ------ macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift | 6 ------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift b/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift index 0ad89faf8..ad979fa55 100644 --- a/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift +++ b/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift @@ -12,6 +12,12 @@ extension Ghostty { // changed with escape codes. @Published var pwd: String? + // The cell size of this surface. This is set by the core when the + // surface is first created and any time the cell size changes (i.e. + // when the font size changes). This is used to allow windows to be + // resized in discrete steps of a single cell. + @Published var cellSize: CGSize = .zero + 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 37c08d6f5..412cb6f5e 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift @@ -21,12 +21,6 @@ extension Ghostty { } } - // The cell size of this surface. This is set by the core when the - // surface is first created and any time the cell size changes (i.e. - // when the font size changes). This is used to allow windows to be - // resized in discrete steps of a single cell. - @Published var cellSize: NSSize = .zero - // The health state of the surface. This currently only reflects the // renderer health. In the future we may want to make this an enum. @Published var healthy: Bool = true diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift index 39201c396..71ac301e0 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift @@ -9,12 +9,6 @@ extension Ghostty { // to the app level and it is set from there. @Published var title: String = "👻" - // The cell size of this surface. This is set by the core when the - // surface is first created and any time the cell size changes (i.e. - // when the font size changes). This is used to allow windows to be - // resized in discrete steps of a single cell. - @Published var cellSize: OSSize = .zero - // The health state of the surface. This currently only reflects the // renderer health. In the future we may want to make this an enum. @Published var healthy: Bool = true