+ // If mClearFocusOnTouch is false, do not clear the focus even if user touch the screen.
+ if(mClearFocusOnTouch)
+ {
+ ClearFocus();
+ }
+
+ // If KEYBOARD_FOCUSABLE and TOUCH_FOCUSABLE is true, set focus actor
+ Actor hitActor = touch.GetHitActor(0);
+ if(hitActor && hitActor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) && hitActor.GetProperty<bool>(DevelActor::Property::TOUCH_FOCUSABLE))
+ {
+ SetCurrentFocusActor(hitActor);
+ }
+ }
+}
+
+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;
+ }