Leaving State (if quit=true) only inside Window's main loop