- // If this is the top-most actor, pop it and change focus to the previous control
- if( pos == mFocusStack.End() - 1 )
- {
- mFocusStack.Erase( pos );
-
- Toolkit::Control previouslyFocusedControl = GetCurrentFocusControl();
- if( previouslyFocusedControl )
- {
- // Tell the control that it has gained focus.
- GetImplementation( previouslyFocusedControl ).OnKeyInputFocusGained();
- }
- }
- else
- {
- // If the removed control is not currently focused, then no need to emit signal.
- mFocusStack.Erase( pos );
- }
- }