From 40e882ff487d48d35ff00c8e2156efd4e6eb50f1 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 28 Dec 2023 19:39:47 -0800 Subject: [PATCH] macos: invalid restorable state when surface is closed Fixes #1177 --- macos/Sources/Ghostty/SurfaceView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 47f5e542f..0eaf31305 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -374,6 +374,10 @@ extension Ghostty { } deinit { + // Whenever the surface is removed, we need to note that our restorable + // state is invalid to prevent the surface from being restored. + invalidateRestorableState() + trackingAreas.forEach { removeTrackingArea($0) } // mouseExited is not called by AppKit one last time when the view