mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: try to save window state before sparkle restart
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import Sparkle
|
||||
import Cocoa
|
||||
|
||||
class UpdaterDelegate: NSObject, SPUUpdaterDelegate {
|
||||
func feedURLString(for updater: SPUUpdater) -> String? {
|
||||
@ -8,4 +9,12 @@ class UpdaterDelegate: NSObject, SPUUpdaterDelegate {
|
||||
// tip appcast URL since it is all we support.
|
||||
return "https://tip.files.ghostty.dev/appcast.xml"
|
||||
}
|
||||
|
||||
func updaterWillRelaunchApplication(_ updater: SPUUpdater) {
|
||||
// When the updater is relaunching the application we want to get macOS
|
||||
// to invalidate and re-encode all of our restorable state so that when
|
||||
// we relaunch it uses it.
|
||||
NSApp.invalidateRestorableState()
|
||||
for window in NSApp.windows { window.invalidateRestorableState() }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user