From 5f9e1fc1a561e2786c6d121c720bf9dbc8007218 Mon Sep 17 00:00:00 2001 From: Harlan Haskins Date: Fri, 3 Jan 2025 10:45:06 -0500 Subject: [PATCH] Fix new deprecation warnings introduced by bumping deployment target --- .../Features/Terminal/TerminalView.swift | 22 +++++++++---------- macos/Sources/Ghostty/InspectorView.swift | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/macos/Sources/Features/Terminal/TerminalView.swift b/macos/Sources/Features/Terminal/TerminalView.swift index aa8ab7381..c73e40cc4 100644 --- a/macos/Sources/Features/Terminal/TerminalView.swift +++ b/macos/Sources/Features/Terminal/TerminalView.swift @@ -91,27 +91,27 @@ struct TerminalView: 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 diff --git a/macos/Sources/Ghostty/InspectorView.swift b/macos/Sources/Ghostty/InspectorView.swift index 32538ef62..d4c36199f 100644 --- a/macos/Sources/Ghostty/InspectorView.swift +++ b/macos/Sources/Ghostty/InspectorView.swift @@ -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()