From: Tom Robinson Date: Tue, 3 Nov 2015 16:29:26 +0000 (+0000) Subject: Fixed KeyboardFocusManager::ClearFocus is called twice on focus loss X-Git-Tag: dali_1.1.10~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbab22cfb2c0285080e2dee20615f037d7f93227;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Fixed KeyboardFocusManager::ClearFocus is called twice on focus loss Change-Id: I65e456dcea2011a4bdfe4db2afe8cc072107e50e --- 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 4e57496..ae7d741 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -132,9 +132,9 @@ bool KeyboardFocusManager::SetCurrentFocusActor(Actor actor) { DALI_ASSERT_DEBUG( !mIsWaitingKeyboardFocusChangeCommit && "Calling this function in the PreFocusChangeSignal callback?" ); - if(actor) + if( actor ) { - return DoSetCurrentFocusActor(actor.GetId()); + return DoSetCurrentFocusActor( actor.GetId() ); } return false; @@ -695,8 +695,12 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) void KeyboardFocusManager::OnTouched(const TouchEvent& touchEvent) { - // Clear the focus when user touch the screen - ClearFocus(); + // Clear the focus when user touch the screen. + // We only do this on a Down event, otherwise the clear action may override a manually focused actor. + if( ( touchEvent.GetPointCount() < 1 ) || ( touchEvent.GetPoint( 0 ).state == TouchPoint::Down ) ) + { + ClearFocus(); + } } Toolkit::KeyboardFocusManager::PreFocusChangeSignalType& KeyboardFocusManager::PreFocusChangeSignal()