From 7983ab0c64db50521eb52e0ba6f91196fc9c4cca Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Mon, 28 Mar 2022 13:14:36 +0900 Subject: [PATCH] FocusChanged callback should be called after Focus has changed. It is now called before Focus is changed. So calling GetCurrentFocusActor() inside the FocusChanged callback returns the prvious actor. This is a problem. So, change the FocusChanged callback to be called after the Focus is changed. Change-Id: Ie270822ac01196e0bf9a18c2e9ab58326fcb745b --- .../internal/focus-manager/keyboard-focus-manager-impl.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 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 977e2e0..d492a29 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -251,11 +251,6 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor) actor.Add(GetFocusIndicatorActor()); } - // Send notification for the change of focus actor - if(!mFocusChangedSignal.Empty()) - { - mFocusChangedSignal.Emit(currentFocusedActor, actor); - } Toolkit::Control currentlyFocusedControl = Toolkit::Control::DownCast(currentFocusedActor); if(currentlyFocusedControl) @@ -265,8 +260,6 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor) currentlyFocusedControl.ClearKeyInputFocus(); } - DALI_LOG_INFO(gLogFilter, Debug::General, "[%s:%d] Focus Changed\n", __FUNCTION__, __LINE__); - // Save the current focused actor mCurrentFocusActor = actor; @@ -303,6 +296,11 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor) mFocusHistory.erase(beginPos); } + // Send notification for the change of focus actor + if(!mFocusChangedSignal.Empty()) + { + mFocusChangedSignal.Emit(currentFocusedActor, actor); + } DALI_LOG_INFO(gLogFilter, Debug::General, "[%s:%d] SUCCEED\n", __FUNCTION__, __LINE__); success = true; } -- 2.7.4