I’m working on building an application that has a primary volumetric window that opens a plain settings window and I would like to dismiss it when the user shifts focus back to the main window. To accomplish this, I’d like to detect the focus of the main window and dismiss the settings window when focus changes.
I’ve tried using:
@Environment(\.controlActiveState) var controlActiveState
but this seems to be unavailable on VisionOS.
Things like .focused on the view seem to be related to setting the focus state vs. detecting the focus state.
Any ideas on how to detect the currently active window?