mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-14 11:35:48 +00:00
macOS: add focusDidChange & sizeDidChange placeholders to OSSurfaceView
This commit is contained in:
@@ -91,6 +91,12 @@ extension Ghostty {
|
||||
self?.highlighted = false
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Placeholders
|
||||
|
||||
func focusDidChange(_ focused: Bool) {}
|
||||
|
||||
func sizeDidChange(_ size: CGSize) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user