X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyboard-focus-manager-impl.cpp;h=b77b2b884f6f75270cdcee11fab5ed93c433421d;hp=d0daa9f8c0be0aab658a729ee7d4a52481016400;hb=43ff1980e2bbdac95026be086673db155737b305;hpb=b33712a17095254f5a42eb2458c7e2f840fd8a13 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 d0daa9f..b77b2b8 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -119,6 +119,7 @@ KeyboardFocusManager::KeyboardFocusManager() mFocusedActorEnterKeySignal(), mCurrentFocusActor(), mFocusIndicatorActor(), + mFocusFinderRootActor(), mFocusHistory(), mSlotDelegate(this), mCustomAlgorithmInterface(NULL), @@ -520,25 +521,28 @@ bool KeyboardFocusManager::MoveFocus(Toolkit::Control::KeyboardFocus::Direction } else if (mEnableDefaultAlgorithm) { - Layer rootLayer; - if (currentFocusActor) + Actor rootActor = mFocusFinderRootActor.GetHandle(); + if(!rootActor) { - // Find the window of the focused actor. - Integration::SceneHolder window = Integration::SceneHolder::Get(currentFocusActor); - if (window) + if (currentFocusActor) { - rootLayer = window.GetRootLayer(); + // Find the window of the focused actor. + Integration::SceneHolder window = Integration::SceneHolder::Get(currentFocusActor); + if (window) + { + rootActor = window.GetRootLayer(); + } + } + else + { + // Searches from the currently focused window. + rootActor = mCurrentFocusedWindow.GetHandle(); } } - else - { - // Searches from the currently focused window. - rootLayer = mCurrentFocusedWindow.GetHandle(); - } - if (rootLayer) + if(rootActor) { // We should find it among the actors nearby. - nextFocusableActor = Toolkit::FocusFinder::GetNearestFocusableActor(rootLayer, currentFocusActor, direction); + nextFocusableActor = Toolkit::FocusFinder::GetNearestFocusableActor(rootActor, currentFocusActor, direction); } } } @@ -1184,6 +1188,16 @@ bool KeyboardFocusManager::IsDefaultAlgorithmEnabled() const return mEnableDefaultAlgorithm; } +void KeyboardFocusManager::SetFocusFinderRootActor(Actor actor) +{ + mFocusFinderRootActor = actor; +} + +void KeyboardFocusManager::ResetFocusFinderRootActor() +{ + mFocusFinderRootActor.Reset(); +} + } // namespace Internal } // namespace Toolkit