The new function capi:pane-descendant-child-with-focus returns the child pane of a specified parent pane or layout that currently has the input focus, if there is one.
capi:pane-descendant-child-with-focus