mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-17 13:02:42 +00:00
24 lines
650 B
Swift
24 lines
650 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 {
|
|
if surface.id == id {
|
|
return surface
|
|
}
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
}
|