[Tizen] Do nothing when setting focus on same actor 54/122354/1
authordongsug.song <dongsug.song@samsung.com>
Fri, 31 Mar 2017 05:43:56 +0000 (14:43 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Fri, 31 Mar 2017 05:43:59 +0000 (14:43 +0900)
This reverts commit c7db626fe12c997353acf3524fd819a1420116e0.

Change-Id: Ie29df40b3f07dd9ac90ef825a45ff25419abf814

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

index d3e4b88..ef613e7 100644 (file)
@@ -144,6 +144,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() )
   {
@@ -151,9 +163,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);