added method to figure out whether a component is actually visible on the screen or not