Improve detection of when a view is a widget/panel