Previously the window size and position was obtained in such a way that
when the window is closed while minimized, it would be hidden when the
program is started again. Closing a maximized window would save the
size of the maximized window and use it as the normal/restored size when
the program is started again.