From 9c051cd8ef4e8b3d2019fd659e24e2d6be2cb85a Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Tue, 2 May 2017 11:05:48 +0900 Subject: [PATCH] [Tizen] Do nothing when setting focus on same actor This reverts commit 484d8acdc7efb1074de38d39eee8723a91b827d7. Change-Id: I6ffd18c019cf7afa727c20f99496640062cc2dbd --- .../focus-manager/keyboard-focus-manager-impl.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp index d58560d..2ad1502 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -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); -- 2.7.4