[Tizen] Do nothing when setting focus on same actor 32/124032/1
authorminho.sun <minho.sun@samsung.com>
Mon, 10 Apr 2017 03:28:07 +0000 (12:28 +0900)
committerminho.sun <minho.sun@samsung.com>
Mon, 10 Apr 2017 03:28:08 +0000 (12:28 +0900)
This reverts commit 9c9dc87201fedb92117e15c4c67dce75a8cfa101.

Change-Id: I28df08b6fddc823773db8808ac38d6a35bab8e45

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);