+ // if mIsFocusIndicatorShown is UNKNOWN, it means Configuration is not loaded.
+ // Try to load configuration.
+ if( mIsFocusIndicatorShown == UNKNOWN )
+ {
+ GetConfigurationFromStyleManger();
+ }
+
+ // Clear the focus when user touch the screen.
+ // We only do this on a Down event, otherwise the clear action may override a manually focused actor.
+ // If mClearFocusOnTouch is false, do not clear the focus even if user touch the screen.
+ if( (( touch.GetPointCount() < 1 ) || ( touch.GetState( 0 ) == PointState::DOWN )) && mClearFocusOnTouch )
+ {
+ ClearFocus();
+ }
+}
+
+void KeyboardFocusManager::OnWindowFocusChanged(Window window, bool focusIn )
+{
+ if( focusIn && mCurrentFocusedWindow.GetHandle() != window.GetRootLayer() )
+ {
+ // Change Current Focused Window
+ Layer rootLayer = window.GetRootLayer();
+ mCurrentFocusedWindow = rootLayer;
+
+ // Get Current Focused Actor from window
+ Actor currentFocusedActor = GetFocusActorFromCurrentWindow();
+ SetCurrentFocusActor( currentFocusedActor );
+
+ if( currentFocusedActor && ( mEnableFocusIndicator == ENABLE ) )
+ {
+ // Make sure the focused actor is highlighted
+ currentFocusedActor.Add( GetFocusIndicatorActor() );
+ mIsFocusIndicatorShown = SHOW;
+ }
+ }