WindowGroup bug??? Can't maximize window after minimizing

I've been playing around with SwiftUI for macOS 11 Big Sur (Beta 5 as of right now) and got pretty far with (almost) vanilla SwiftUI.
Though, it seems like impossible for me to figure out how to manage windows...
  1. When I minimize my only Scene/Window, I can click on the App Icon as often as I want, the window won't maximize. It is, though, accessible through'Right-click App Icon' & 'Show all windows'. How can I change that?

  2. My App doesn't need multiple windows & therefore shouldn't allow them (including CMD+N), so the user doesn't get confused. Is there a way yet in SwiftUI to change that behavior, that 'comes for free with WindowGroup'... GREAT! :D

  3. I use a sidebar. Most of the 2nd levels views don't require a 3rd level view. One does. So, I created a HSplitView inside one of the 2nd level views. I created a 2nd List {} inside the HSplitView & a detail view (like in the Mail App) right next to it. Selecting & everything works fine... Except: When I tab out of the App Window (to Safari or whatever), the Sidebar forever disappears... No way of getting it back... trust me, I've tried. But it reappears when I open a new window, thanks to point 2 :D That literally seems like a legit bug to me or am I mistaken?

Thanks for everyone who replies!
Maybe I am just stupid, after all :D

Small world. I have been banging my head for hours on this. I have a real SwiftUI app, with one Window.

When this Window (mainWindow/keyWindow) is minimized an icon is added on the dock. Now if i click on the app icon, i expect this minimized window to expand again. But it does not.

If i switch to another app and than click on the app icon on the doc, the minimized window is expanded as expected.

It appears the app thinks it is still active applicationDidResignActive: is not called.

@eskimo What magic is going on pls ?

This is a known bug and has been fixed on Xcode 14, beta 5 and macOS 13.

If you need this feature on older systems, such as macOS 11 + you will need to go back and use a MainMenu.xib and an AppDelegate

struct SwiftUIView: View {

    var body: some View {
        Text("Hello, SwiftUI!")
            .frame(maxWidth: .infinity, maxHeight: .infinity)
    }
}

@main

class AppDelegate: NSObject, NSApplicationDelegate {
    @IBOutlet var window: NSWindow!

    func applicationDidFinishLaunching(_ aNotification: Notification) {
        // Insert code here to initialize your application

        window = NSWindow(
            contentRect: NSRect(x: 0, y: 0, width: 480, height: 270),
            styleMask: [.miniaturizable, .closable, .resizable, .titled],
            backing: .buffered, defer: false)

        window.center()
        window.title = "No Storyboard Window"
        window.contentView = NSHostingView(rootView: SwiftUIView())
        window.makeKeyAndOrderFront(nil)
    }

    func applicationWillTerminate(_ aNotification: Notification) {
        // Insert code here to tear down your application
    }

    func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
        return true
    }
}
WindowGroup bug??? Can't maximize window after minimizing
 
 
Q