I've seen it happen with my games too. Not sure about how to avoid that. I'm wondering if you could switch off view stages if the game window loses focus, or perhaps there is a windows.h command that would let you prevent a screensaver from running.