Fix the computation of the window size.

When the requested window size did not fit in the screen, the ratio applied to
the size must be applied to the requested size, not the screen size.

Also, the double/int mix used to create a 0x0 window.