From a7ea628b9eda4d254f5e4bfe0bd0a874c8c20f56 Mon Sep 17 00:00:00 2001 From: "taeyoon0.lee" Date: Tue, 25 Apr 2017 15:41:18 +0900 Subject: [PATCH 1/1] [Tizen] Do nothing when setting focus on same actor This reverts commit 9f17d9e3a1a7a018ab29ee6379b1207997225424. Change-Id: I6624dae2426402f368126f95c7a830f46d8a60c2 --- .../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