Better handling of top-level widgets (i.e. widgets with no parents).