Is there really no way to make a SwiftUI window be non-activating? Like if I wanted to make a floating panel that contained an inspector like many Mac apps do / did. I know I can place my SwiftUI inside an NSPanel but then it is janky as hell as the SwiftUI resizing fights with the AppKit resizing and everything jumps around.
@Gte I don’t think you can even center a SwiftUI window when it opens without dropping down to AppKit. SwiftUI on macOS has a LONG way to go…
@siracusa Yeah. I had to jump through some weird hoops for various menu things. You (understandably) can’t get the native window handle so you can’t take control of it as you’d like. There’s some rough spots for sure. This is a personal experimental app so that’s fine and part of the purpose of doing it. But I think the AppKit escape hatch approach still needs to be taken if you stay too far off what they expect.
@Gte You can totally get at the NSWindow from a SwiftUI view in an NSHostingView, which is necessary to do a bunch of things, but’s gross.
@siracusa Sorry, yeah. I’d meant that you can’t get it in modifiers and such in SwiftUI land. The way the app is stuck together is still AppKit and I’ve been taking advantage of that to get specific things done. Yesterday I discovered you can’t put custom views inside SwiftUI menus even though NSMenuItrm has a view property. So I had to poke around to get that working.