[Tizen] Do nothing when setting focus on same actor 77/120377/3 accepted/tizen/common/20170324.123014 accepted/tizen/ivi/20170324.112109 accepted/tizen/mobile/20170324.111633 accepted/tizen/tv/20170324.111921 accepted/tizen/unified/20170324.112204 accepted/tizen/wearable/20170324.112015 submit/tizen/20170324.082849
authorminho.sun <minho.sun@samsung.com>
Wed, 22 Mar 2017 13:16:50 +0000 (22:16 +0900)
committerMinho Sun <minho.sun@samsung.com>
Thu, 23 Mar 2017 10:35:28 +0000 (03:35 -0700)
Do nothing when setting focus on same actor.

Change-Id: Iec7a5e11bca9f44a7b197448ff732143ea44036b
Signed-off-by: minho.sun <minho.sun@samsung.com>
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp

index ccb2169..b703c63 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);