Move window creation from viewer do-task loop to 2nd stage initialization.