Set window state at init, so it will be sized properly

Otherwise the window size is wrong when it is positioned. This raises a problem
because it is notrepositioned after resize.