a more powerful computer? more RAM?
Have you checked to make sure you aren't using something with known graphics driver issues?
Sounds like PC is on the edge, and standard Operating System handling of change of foreground app is pushing system over the edge. If that is the case, then lowering workload (OS level, and/or other apps or OBS settings) to give yourself some headroom, or a more appropriate PC for what you are asking it to do (could be simple upgrade or complete replacement... it depends). And of course, it could be a recent Windows update messing things up, or conflict with video card driver, or ??