Lag when not clicked on

Hi There I have an issiue when I run a simulation it runs smoothly as long as i click inside the unreal software.However if I am ruuning the simualtion and i click anywhere outside of the software it instantly lags.My CPU GPU and memery are all below 30% thanks