X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyboard-focus-manager-impl.cpp;h=2ad1502a0006deddbcf0c18d4015cd50da681677;hb=a7ea628b9eda4d254f5e4bfe0bd0a874c8c20f56;hp=d3e4b88e1b5d6528de74570493c005afd087c42e;hpb=c7db626fe12c997353acf3524fd819a1420116e0;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git 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 d3e4b88..2ad1502 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include namespace Dali @@ -125,7 +124,7 @@ KeyboardFocusManager::KeyboardFocusManager() mCustomAlgorithmInterface(NULL) { // TODO: Get FocusIndicatorEnable constant from stylesheet to set mIsFocusIndicatorEnabled. - Toolkit::KeyInputFocusManager::Get().UnhandledKeyEventSignal().Connect(mSlotDelegate, &KeyboardFocusManager::OnKeyEvent); + Stage::GetCurrent().KeyEventSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent); Stage::GetCurrent().TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch ); } @@ -144,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() ) { @@ -151,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);