diff --git a/macos/Ghostty.xcodeproj/project.pbxproj b/macos/Ghostty.xcodeproj/project.pbxproj index f97a91ae7..7e919e969 100644 --- a/macos/Ghostty.xcodeproj/project.pbxproj +++ b/macos/Ghostty.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ A5B30539299BEAAB0047F10C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5B30538299BEAAB0047F10C /* Assets.xcassets */; }; A5CEAFDC29B8009000646FDA /* SplitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CEAFDB29B8009000646FDA /* SplitView.swift */; }; A5CEAFDE29B8058B00646FDA /* SplitView.Divider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CEAFDD29B8058B00646FDA /* SplitView.Divider.swift */; }; + A5CEAFFF29C2410700646FDA /* Backport.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CEAFFE29C2410700646FDA /* Backport.swift */; }; A5D495A2299BEC7E00DD1313 /* GhosttyKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5D495A1299BEC7E00DD1313 /* GhosttyKit.xcframework */; }; /* End PBXBuildFile section */ @@ -35,6 +36,7 @@ A5B3053D299BEAAB0047F10C /* Ghostty.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Ghostty.entitlements; sourceTree = ""; }; A5CEAFDB29B8009000646FDA /* SplitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplitView.swift; sourceTree = ""; }; A5CEAFDD29B8058B00646FDA /* SplitView.Divider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplitView.Divider.swift; sourceTree = ""; }; + A5CEAFFE29C2410700646FDA /* Backport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Backport.swift; sourceTree = ""; }; A5D495A1299BEC7E00DD1313 /* GhosttyKit.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = GhosttyKit.xcframework; sourceTree = ""; }; /* End PBXFileReference section */ @@ -60,6 +62,7 @@ A535B9D9299C569B0017E2E4 /* ErrorView.swift */, A55685DF29A03A9F004303CE /* AppError.swift */, A59444F629A2ED5200725BBA /* SettingsView.swift */, + A5CEAFFE29C2410700646FDA /* Backport.swift */, ); path = Sources; sourceTree = ""; @@ -196,6 +199,7 @@ A55685E029A03A9F004303CE /* AppError.swift in Sources */, A535B9DA299C569B0017E2E4 /* ErrorView.swift in Sources */, A5B30535299BEAAA0047F10C /* GhosttyApp.swift in Sources */, + A5CEAFFF29C2410700646FDA /* Backport.swift in Sources */, A5CEAFDE29B8058B00646FDA /* SplitView.Divider.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/macos/Sources/Backport.swift b/macos/Sources/Backport.swift new file mode 100644 index 000000000..1af5e6fe1 --- /dev/null +++ b/macos/Sources/Backport.swift @@ -0,0 +1,25 @@ +import SwiftUI + +// All backport view/scene modifiers go as an extension on this. We use this +// so we can easily track and centralize all backports. +struct Backport { + let content: Content +} + +extension View { + var backport: Backport { Backport(content: self) } +} + +extension Scene { + var backport: Backport { Backport(content: self) } +} + +extension Backport where Content: Scene { + func defaultSize(width: CGFloat, height: CGFloat) -> some Scene { + if #available(macOS 13, *) { + return content.defaultSize(width: width, height: height) + } else { + return content + } + } +} diff --git a/macos/Sources/GhosttyApp.swift b/macos/Sources/GhosttyApp.swift index 7c12e8f4e..1e6fabc43 100644 --- a/macos/Sources/GhosttyApp.swift +++ b/macos/Sources/GhosttyApp.swift @@ -27,7 +27,9 @@ struct GhosttyApp: App { Ghostty.TerminalSplit(onClose: Self.closeWindow) .ghosttyApp(ghostty.app!) } - }.commands { + } + .backport.defaultSize(width: 800, height: 600) + .commands { CommandGroup(after: .newItem) { Button("New Tab", action: Self.newTab).keyboardShortcut("t", modifiers: [.command]) Divider() diff --git a/vendor/libxev b/vendor/libxev index 59132b17b..46e3dafa4 160000 --- a/vendor/libxev +++ b/vendor/libxev @@ -1 +1 @@ -Subproject commit 59132b17bc800eab7d3e995fcda42e835dba5df6 +Subproject commit 46e3dafa477a9a92abe7b425cafdbcbe7ba3574d