Quick answer: Pygame event loop pausing when window loses focus on Windows? Window event consumes time - filter or set event timeout.

Alt-tab; game shows 'not responding' for 2 seconds.

Use event.poll instead

Non-blocking. Returns NOEVENT if nothing; doesn't wait for OS.

Or filter focus events

set_blocked WINDOWFOCUSLOST; doesn't consume; doesn't block.

Profile per OS

Behavior differs Windows vs Linux. Test both.

“Event loops can block. Polling is the unblocking choice.”

If your game freezes during focus changes, the event loop strategy is the suspect.

Related reading