'Fullscreen SwiftUI windows look strange due to Toolbar or Tab bars

Fixed sized SwiftUI windows with toolbar have an extra band in full-screen mode. This seems like a bug. If a tab bar is also added (by pressing Command+N in fullscreen mode) the extra band doubles. How to get rid of these bands?

normal window fullscreen window fullscreen with tabs

struct ContentView: View {
    var body: some View {
        Circle()
        .toolbar {
            Button(action:{}) {
                Label("Favorites", systemImage: "heart")
            }
        }
        .frame(width: 400, height: 30)
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source