ref #80 fix window state recovery