Add window state comparison and timeout check to the ApplicationFactory