My SwiftUI app for macOS allows only a single window. When I open and then close it, its icon remains in the "recently used apps" section of the Dock:
Is there a way to make sure that my app icon does not stay in the "recently used apps" in the Dock?
PS. The reason I need this is because my app can restart as root (after a UI command), which leaves two icons on the Dock there.
