Preserve window state between sessions [Closes #361]