Restore maximized state of window

Closes #2951