Merge "Automatic image atlasing" into devel/master
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Mon, 9 Nov 2015 16:37:02 +0000 (08:37 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 9 Nov 2015 16:37:02 +0000 (08:37 -0800)
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp

index 4e57496..ae7d741 100644 (file)
@@ -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()