For the first part of your question, test the built-in template called window when creating a new project. You will see that the 2d window does not disappear when you enter the immersive view. You can take a look at the code in the ContentView file that shows how this pipeline works.