Stage Manager macOS Ventura : open application in the same group as another application

I am looking to solve a problem in an application’s behaviour with Stage Manager on macOS Ventura. Is it possible to open a window within the same application group as another application? In other words, app A is on screen with Stage Manager active. App A opens app B, and app B’s window becomes active. Can app B’s window open in the same group as app A? App A should not move to the recent apps on the left of the screen.

I expected one of the enumeration values of NSWindowCollectionBehavior to be the answer, but I have not achieved the desired result. I am setting the collection behaviour on the window in the window controller’s awakeFromNib method. NSWindowCollectionBehaviorCanJoinAllApplications is the closest to what I want. The window opens in the correct space/group. However, with this value, the window does not participate in Stage Manager. Are there other properties of NSWindow that can achieve this result? Should NSWindowCollectionBehavior be used in combination with other properties?

I have the same problem , or how to launch the app B with the app A become a group for the stage manger?

Stage Manager macOS Ventura : open application in the same group as another application
 
 
Q