[Tizen] Do nothing when setting focus on same actor 27/127827/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 2 May 2017 02:05:48 +0000 (11:05 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 2 May 2017 02:05:57 +0000 (11:05 +0900)
This reverts commit 484d8acdc7efb1074de38d39eee8723a91b827d7.

Change-Id: I6ffd18c019cf7afa727c20f99496640062cc2dbd

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