Merge "Unset window destroying state only if its surface is destroyed" into main