Fixed a bug of WindowStateManager that causes window size restores incorrect.