[Tizen] Do nothing when setting focus on same actor 92/128192/1
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 8 May 2017 04:02:34 +0000 (13:02 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 8 May 2017 04:02:46 +0000 (13:02 +0900)
Change-Id: I4fad14edf2b4ccce64e65fe8e25c10d4428d4050

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