mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-14 03:25:50 +00:00
feat(macos): focus surface view if search box is manually closed (#10396)
Currently, if a user clicks the "xmark" button to close the search box, the main interface does not regain focus until clicked again. This patch focuses the surface view upon closing.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user