Preserve window state(minimal, window position and size on window resize event