Fix new deprecation warnings introduced by bumping deployment target

This commit is contained in:
Harlan Haskins
2025-01-03 10:45:06 -05:00
parent eda7f10529
commit 5f9e1fc1a5
2 changed files with 13 additions and 13 deletions

View File

@ -91,27 +91,27 @@ struct TerminalView<ViewModel: TerminalViewModel>: View {
.environment(ghostty)
.focused($focused)
.onAppear { self.focused = true }
.onChange(of: focusedSurface) { newValue in
self.delegate?.focusedSurfaceDidChange(to: newValue)
.onChange(of: focusedSurface) {
self.delegate?.focusedSurfaceDidChange(to: focusedSurface)
}
.onChange(of: title) { newValue in
self.delegate?.titleDidChange(to: newValue)
.onChange(of: title) {
self.delegate?.titleDidChange(to: title)
}
.onChange(of: pwdURL) { newValue in
self.delegate?.pwdDidChange(to: newValue)
.onChange(of: pwdURL) {
self.delegate?.pwdDidChange(to: pwdURL)
}
.onChange(of: cellSize) { newValue in
guard let size = newValue else { return }
.onChange(of: cellSize) {
guard let size = cellSize else { return }
self.delegate?.cellSizeDidChange(to: size)
}
.onChange(of: viewModel.surfaceTree?.hashValue) { _ in
.onChange(of: viewModel.surfaceTree?.hashValue) {
// This is funky, but its the best way I could think of to detect
// ANY CHANGE within the deeply nested surface tree -- detecting a change
// in the hash value.
self.delegate?.surfaceTreeDidChange()
}
.onChange(of: zoomedSplit) { newValue in
self.delegate?.zoomStateDidChange(to: newValue ?? false)
.onChange(of: zoomedSplit) {
self.delegate?.zoomStateDidChange(to: zoomedSplit ?? false)
}
}
// Ignore safe area to extend up in to the titlebar region if we have the "hidden" titlebar style

View File

@ -37,10 +37,10 @@ extension Ghostty {
}
}
.onReceive(pubInspector) { onControlInspector($0) }
.onChange(of: surfaceView.inspectorVisible) { inspectorVisible in
.onChange(of: surfaceView.inspectorVisible) {
// When we show the inspector, we want to focus on the inspector.
// When we hide the inspector, we want to move focus back to the surface.
if (inspectorVisible) {
if (surfaceView.inspectorVisible) {
// We need to delay this until SwiftUI shows the inspector.
DispatchQueue.main.async {
_ = surfaceView.resignFirstResponder()