Pause and unpause the simulation when application is active/inactive