I am also having the problem. as a workaround if i trigger this func
func triggerNewWindowMenuItem() {
guard let mainMenu = NSApp.mainMenu else { return }
// Locate the "File" menu
if let fileMenuItem = mainMenu.items.first(where: { $0.title == "File" }),
let fileSubmenu = fileMenuItem.submenu {
// Locate the "New Window" item by title
if let newWindowMenuItem = fileSubmenu.items.first(where: { $0.title == "New Window" }),
let action = newWindowMenuItem.action {
// Trigger its action
NSApp.sendAction(action, to: newWindowMenuItem.target, from: nil)
}
}
}
func applicationDidFinishLaunching(_ notification: Notification) {
if NSApp.windows.isEmpty {
self.triggerNewWindowMenuItem()
}
It just a workaround. hope apple comes up with a proper fix for this.
Topic:
UI Frameworks
SubTopic:
SwiftUI