Add support to restore the window to maximized if it was closed when maximized. Additional work for VIX-340.