- nextFocusableActor = Toolkit::FocusFinder::GetNearestFocusableActor(window.GetRootLayer(), currentFocusActor, direction);
+ // Find the window of the focused actor.
+ Integration::SceneHolder window = Integration::SceneHolder::Get(currentFocusActor);
+ if (window)
+ {
+ rootLayer = window.GetRootLayer();
+ }
+ }
+ else
+ {
+ // Searches from the currently focused window.
+ rootLayer = mCurrentFocusedWindow.GetHandle();
+ }
+ if (rootLayer)
+ {
+ // We should find it among the actors nearby.
+ nextFocusableActor = Toolkit::FocusFinder::GetNearestFocusableActor(rootLayer, currentFocusActor, direction);