[Tizen] Do nothing when setting focus on same actor 93/121193/1 accepted/tizen/common/20170327.143155 accepted/tizen/ivi/20170328.060356 accepted/tizen/mobile/20170328.060003 accepted/tizen/tv/20170328.060155 accepted/tizen/unified/20170328.060447 accepted/tizen/wearable/20170328.060254 submit/tizen/20170327.130356
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 27 Mar 2017 08:06:03 +0000 (17:06 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 27 Mar 2017 08:06:14 +0000 (17:06 +0900)
This reverts commit fbe42421fc6c766a51dabc28f3af6a9e3f2a4436.

Change-Id: I815475e4934bb615bc06c1064d269d490b816485

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