Melt the butter in a large saucepan over medium heat. Add the onion and cook for 3 minutes. Add the rice and cook, stirring constantly, for 2 minutes. Reduce heat to medium-low. Add the wine and cook, stirring frequently, until the liquid is absorbed. Add the broth, 1/2 cup at a time, stirring occasionally and waiting until it's absorbed before adding more. It should take about 30 minutes for all the broth to be absorbed. Remove from heat and stir in the Parmesan, salt, and pepper, then stir in the pesto. Spoon into individual bowls.