feat(macos): focus surface view if search box is manually closed

This commit is contained in:
MrConnorKenway
2026-01-21 20:35:51 +08:00
parent dc43ded149
commit 02d6dc0672

View File

@@ -190,7 +190,12 @@ extension Ghostty {
SurfaceSearchOverlay(
surfaceView: surfaceView,
searchState: searchState,
onClose: { surfaceView.searchState = nil }
onClose: {
#if canImport(AppKit)
Ghostty.moveFocus(to: surfaceView)
#endif
surfaceView.searchState = nil
}
)
}
@@ -432,7 +437,6 @@ extension Ghostty {
#if canImport(AppKit)
.onExitCommand {
if searchState.needle.isEmpty {
Ghostty.moveFocus(to: surfaceView)
onClose()
} else {
Ghostty.moveFocus(to: surfaceView)