When setting a focus actor, we log the current focused actor and the new focused...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / focus-manager / keyboard-focus-manager-impl.cpp
index 3df6d4b..8792ab9 100644 (file)
@@ -149,7 +149,7 @@ void KeyboardFocusManager::OnAdaptorInit()
       (*iter).TouchedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnTouch);
       (*iter).WheelEventGeneratedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnCustomWheelEvent);
       (*iter).WheelEventSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnWheelEvent);
-      Dali::Window window = DevelWindow::DownCast(*iter);
+      Window window = Window::DownCast(*iter);
       if(window)
       {
         window.FocusChangeSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnWindowFocusChanged);
@@ -167,7 +167,7 @@ void KeyboardFocusManager::OnSceneHolderCreated(Dali::Integration::SceneHolder&
   sceneHolder.TouchedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnTouch);
   sceneHolder.WheelEventGeneratedSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnCustomWheelEvent);
   sceneHolder.WheelEventSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnWheelEvent);
-  Dali::Window window = DevelWindow::DownCast(sceneHolder);
+  Window window = Window::DownCast(sceneHolder);
   if(window)
   {
     window.FocusChangeSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnWindowFocusChanged);
@@ -212,8 +212,7 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor)
   if(actor &&
      actor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) &&
      actor.GetProperty<bool>(DevelActor::Property::USER_INTERACTION_ENABLED) &&
-     actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE) &&
-     actor.GetProperty<bool>(Actor::Property::VISIBLE))
+     actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
   {
     // If the parent's KEYBOARD_FOCUSABLE_CHILDREN is false, it cannot have focus.
     Actor parent = actor.GetParent();
@@ -221,7 +220,7 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor)
     {
       if(!parent.GetProperty<bool>(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN))
       {
-        DALI_LOG_INFO(gLogFilter, Debug::General, "[%s:%d] Parent Actor has KEYBOARD_FOCUSABLE_CHILDREN false\n", __FUNCTION__, __LINE__);
+        DALI_LOG_DEBUG_INFO("Parent Actor has KEYBOARD_FOCUSABLE_CHILDREN false\n");
         return false;
       }
       parent = parent.GetParent();
@@ -229,6 +228,7 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor)
 
     // If developer set focus on same actor, doing nothing
     Actor currentFocusedActor = GetCurrentFocusActor();
+    DALI_LOG_DEBUG_INFO("current focused actor : [%p] new focused actor : [%p]\n", currentFocusedActor.GetObjectPtr(), actor.GetObjectPtr());
     if(actor == currentFocusedActor)
     {
       return true;
@@ -986,7 +986,7 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         actor.Add(GetFocusIndicatorActor());
       }
     }
-    else
+    else if(!mEnableDefaultAlgorithm)
     {
       // No actor is focused but keyboard focus is activated by the key press
       // Let's try to move the initial focus