mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
22 lines
593 B
Swift
22 lines
593 B
Swift
import AppKit
|
|
|
|
// MARK: Ghostty Delegate
|
|
|
|
/// This implements the Ghostty app delegate protocol which is used by the Ghostty
|
|
/// APIs for app-global information.
|
|
extension AppDelegate: Ghostty.Delegate {
|
|
func ghosttySurface(id: UUID) -> Ghostty.SurfaceView? {
|
|
for window in NSApp.windows {
|
|
guard let controller = window.windowController as? BaseTerminalController else {
|
|
continue
|
|
}
|
|
|
|
for surface in controller.surfaceTree where surface.id == id {
|
|
return surface
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
}
|