When I encloses the pygame event listener in a loop like this, it works just fine:
def window_event_listener(): while True: for event in pygame.event.