UIs are best implemented as a 2D scene graph, so you can look at how input is handled there. Eg:http://code.google.com/p/libgdx/wiki/scene2d
In scene2d, you have an Actor class which is a basic node in the scene graph. You also have a Group class which is an actor that has a number of actor children. Hit detection is done by asking the root group to check its children. This is recursive since children could be a group that check their children, etc. If an actor reports it was hit, recursion stops and that actor is reported as being hit.
In scene2d, it is unnecessary to set the width and height of your group so it encompasses all the actors. Doing so would be a huge pain if you just want to use the group for translation, rotation, and scaling. So, scene2d lets actors be positioned outside of their parent group's bounds. This means the default hit detection method for group always checks all children, since it can't shortcut just because the hit location is outside the group's bounds. How bad is this? Well consider this complex UI:
scene2d does hit detection for the mouse each frame, so it can fire enter/exit events. The worst case is when the hit location doesn't hit any actors, since all actors will be checked. In this UI 220 actors are checked each frame (68 of those are groups). If the mouse is held down it has to check again, so this doubles. Still, this is not an issue at all on the desktop. If your UI is less complex, there is even less reason to worry.
Still, there is no reason to be inefficient. scene2d.ui is a UI toolkit built on top of scene2d. It has Widget which is an actor and WidgetGroup which is a group. These are specialized actors and groups which know how to do layout and other stuff commonly needed in UIs. Unlike low level scene2d usage for games, when building UIs it is normal to set the bounds of a group so all children are within the group. So, I changed WidgetGroup to not check the children if the hit location is outside of the group. Doing this drops from 220 actors checked each frame in the screenshot above to 21. The whole UI continues to work, so I'll commit