macOS: add focusDidChange & sizeDidChange placeholders to OSSurfaceView

This commit is contained in:
Lukas
2026-04-12 12:45:35 +02:00
parent 90ea604a7c
commit bf6fd4abe5
3 changed files with 10 additions and 4 deletions

View File

@@ -91,6 +91,12 @@ extension Ghostty {
self?.highlighted = false
}
}
// MARK: - Placeholders
func focusDidChange(_ focused: Bool) {}
func sizeDidChange(_ size: CGSize) {}
}
}

View File

@@ -389,7 +389,7 @@ extension Ghostty {
progressReportTimer?.invalidate()
}
func focusDidChange(_ focused: Bool) {
override func focusDidChange(_ focused: Bool) {
guard let surface = self.surface else { return }
guard self.focused != focused else { return }
self.focused = focused
@@ -426,7 +426,7 @@ extension Ghostty {
}
}
func sizeDidChange(_ size: CGSize) {
override func sizeDidChange(_ size: CGSize) {
// Ghostty wants to know the actual framebuffer size... It is very important
// here that we use "size" and NOT the view frame. If we're in the middle of
// an animation (i.e. a fullscreen animation), the frame will not yet be updated.

View File

@@ -45,7 +45,7 @@ extension Ghostty {
ghostty_surface_free(surface)
}
func focusDidChange(_ focused: Bool) {
override func focusDidChange(_ focused: Bool) {
guard let surface = self.surface else { return }
ghostty_surface_set_focus(surface, focused)
@@ -55,7 +55,7 @@ extension Ghostty {
}
}
func sizeDidChange(_ size: CGSize) {
override func sizeDidChange(_ size: CGSize) {
guard let surface = self.surface else { return }
// Ghostty wants to know the actual framebuffer size... It is very important