[Tizen] Do nothing when setting focus on same actor 07/125407/1
authorJinho, Lee <jeano.lee@samsung.com>
Mon, 17 Apr 2017 04:21:12 +0000 (13:21 +0900)
committerJinho, Lee <jeano.lee@samsung.com>
Mon, 17 Apr 2017 04:21:19 +0000 (13:21 +0900)
This reverts commit a34b00c9733bbd285e4e1a362b2b5017386ca557.

Change-Id: Ib93e5fa08be1184f305cc634239f69eec3924143

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