[[ Bug 13072 ]] Only invoke controlgainedfocus() if a control is still focused.
Merge branch 'bugfix-13072' into develop