From 645dea75009f1ace20c59af0ae3f7a4a210fb9aa Mon Sep 17 00:00:00 2001 From: Eunki Hong Date: Thu, 16 Feb 2023 02:35:27 +0900 Subject: [PATCH] Remove useless warning message for initialized window OnWindowFocusChanged can be called when the window is created. In that case, GetFocusActorFromCurrentWindow() will return empty Actor handle. SetCurrentFocusActor() doesn't consider empty-handle input case. So we should skip if GetFocusActorFromCurrentWindow() returns empty handle. Change-Id: I440e60f7c46e234876a4d5af50445477b88e35f7 Signed-off-by: Eunki Hong --- .../focus-manager/keyboard-focus-manager-impl.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 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 707aa68..cb3eeec 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -1097,13 +1097,16 @@ void KeyboardFocusManager::OnWindowFocusChanged(Window window, bool focusIn) // Get Current Focused Actor from window Actor currentFocusedActor = GetFocusActorFromCurrentWindow(); - SetCurrentFocusActor(currentFocusedActor); - - if(currentFocusedActor && (mEnableFocusIndicator == ENABLE)) + if(currentFocusedActor) { - // Make sure the focused actor is highlighted - currentFocusedActor.Add(GetFocusIndicatorActor()); - mIsFocusIndicatorShown = SHOW; + SetCurrentFocusActor(currentFocusedActor); + + if(mEnableFocusIndicator == ENABLE) + { + // Make sure the focused actor is highlighted + currentFocusedActor.Add(GetFocusIndicatorActor()); + mIsFocusIndicatorShown = SHOW; + } } } } -- 2.7.4