Some projections depend only on the aspect ratio (like the perspective projection), but some don’t (like the orthographic projection), so unless I misunderstood, your answer doesn’t completely address my question.
As a side question: is the aspect ratio of the framebuffer guaranteed to be the same as the aspect ratio of the window? Or could it happen that there are different scale factors in x and y coordinates?