diff options
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r-- | src/ui/widget.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index 5afb004f..331192f9 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -734,9 +734,19 @@ iAny *hitChild_Widget(const iWidget *d, iInt2 coord) { | |||
734 | if (d->flags & unhittable_WidgetFlag) { | 734 | if (d->flags & unhittable_WidgetFlag) { |
735 | return NULL; | 735 | return NULL; |
736 | } | 736 | } |
737 | iConstForEach(ObjectList, i, d->children) { | 737 | /* Check for on-top widgets first. */ |
738 | iAny *found = hitChild_Widget(constAs_Widget(i.object), coord); | 738 | if (!d->parent) { |
739 | if (found) return found; | 739 | iForEach(PtrArray, i, onTop_RootData_()) { |
740 | iAny *found = hitChild_Widget(constAs_Widget(i.ptr), coord); | ||
741 | if (found) return found; | ||
742 | } | ||
743 | } | ||
744 | iForEach(ObjectList, i, d->children) { | ||
745 | const iWidget *child = constAs_Widget(i.object); | ||
746 | if (~child->flags & keepOnTop_WidgetFlag) { | ||
747 | iAny *found = hitChild_Widget(child, coord); | ||
748 | if (found) return found; | ||
749 | } | ||
740 | } | 750 | } |
741 | if (contains_Widget(d, coord)) { | 751 | if (contains_Widget(d, coord)) { |
742 | return iConstCast(iWidget *, d); | 752 | return iConstCast(iWidget *, d); |