I want to re-open a window in the exact state when it’s dismissed (in order to show an immersive space in between). But simply calling dismissWindow(id:)
and openWindow(id:)
creates a new instance of the window. There are two approaches I can think of but neither is perfect:
- Save the state and pass that in as a value to
openWindow
. However, the window is my main feed page with a dynamic scroll view. It opens a whole bag of worms, such as reading and setting the scroll offset. - Hide/show the window by using something like
WindowGroup { TabView {}.opacity(showWindow ? 1 : 0) }
. But the system window bar and close button are still visible.