[Tizen] Do nothing when setting focus on same actor 57/129457/1
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Tue, 16 May 2017 11:36:11 +0000 (20:36 +0900)
committertaeyoon0.lee <taeyoon0.lee@samsung.com>
Tue, 16 May 2017 11:36:22 +0000 (20:36 +0900)
This reverts commit 15b61ba8adcc229e3acdae2508b8e4a5701be8a9.

Change-Id: I8dc866ec3e896986b66542eb1df31785834757d3

dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp

index d58560d..2ad1502 100644 (file)
@@ -143,6 +143,18 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( Actor actor )
 {
   bool success = false;
 
+  Actor currentFocusedActor = GetCurrentFocusActor();
+
+  // If developer set focus on same actor, doing nothing
+  if( actor == currentFocusedActor )
+  {
+    if( !actor )
+    {
+      return false;
+    }
+    return true;
+  }
+
   // Check whether the actor is in the stage and is keyboard focusable.
   if( actor && actor.IsKeyboardFocusable() )
   {
@@ -150,9 +162,8 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( Actor actor )
     {
       actor.Add( GetFocusIndicatorActor() );
     }
-    // Send notification for the change of focus actor
-    Actor currentFocusedActor = GetCurrentFocusActor();
 
+    // Send notification for the change of focus actor
     if( !mFocusChangedSignal.Empty() )
     {
       mFocusChangedSignal.Emit(currentFocusedActor, actor);