fix loosing reparented (popup) widgets when clearing or replacing contents.