You minimize OBS Studio after you start your stream/recording. Then edit the infinite screen within a screen segment out with your video editing software.
The other option is to buy another monitor (multi monitor setup) and run OBS in the left monitor and your application you want to capture in the other monitor.