N_SE-39820 : Call SetTouchCanceled, only target is matched
authorminkyu kim <imetjade.kim@samsung.com>
Thu, 30 May 2013 12:23:15 +0000 (21:23 +0900)
committerminkyu kim <imetjade.kim@samsung.com>
Thu, 30 May 2013 12:23:15 +0000 (21:23 +0900)
Change-Id: If55f435abe5a05433201fe89390f3c57afe1fc66

src/ui/FUi_Control.cpp
src/ui/FUi_ControlImpl.cpp

index aa5a44e..8b3748c 100644 (file)
@@ -935,6 +935,17 @@ _Control::OnVisibleStateChanged(void)
 void
 _Control::OnAncestorVisibleStateChanged(const _Control& control)
 {
+       _TouchManager* pTouchManager = _TouchManager::GetInstance();
+       if (pTouchManager)
+       {
+               if(pTouchManager->GetTouchControlSource() == this)
+               {
+                       SysLog(NID_UI, "VisibleState changed false, Call SetTouchCanceled");
+                       pTouchManager->SetTouchCanceled(null);
+                       pTouchManager->ResetTouchInfo();
+               }
+       }
+
        if (IsVisible() == false)
        {
                _Control* pControl = GetFocused();
@@ -3041,10 +3052,10 @@ _Control::SetVisibleState(bool visibleState)
        if (changed)
        {
                GetControlDelegate().OnVisibleStateChanged();
+               CallOnAncestorVisibleStateChanged();
                _Control* pParent = GetParent();
                if (pParent)
                {
-                       CallOnAncestorVisibleStateChanged();
                        pParent->GetControlDelegate().OnChildVisibleStateChanged(*this);
                }
 
index 37dc4c1..fb1cf93 100644 (file)
@@ -2756,43 +2756,6 @@ _ControlImpl::OnVisibleStateChanging(void)
 void
 _ControlImpl::OnVisibleStateChanged(void)
 {
-       _TouchManager* pTouchManager = _TouchManager::GetInstance();
-       if (pTouchManager)
-       {
-               if ((_TouchManager::GetInstance()->IsTouchAllowed() == true) && (GetPublic().GetShowState() == false))
-               {
-                       _ControlManager* pControlManager = _ControlManager::GetInstance();
-                       SysTryReturnVoidResult(NID_UI, pControlManager, E_SYSTEM, "[E_SYSTEM] _ControlManager does not exist.");
-
-                       bool gestureDetecting = false;
-
-                       IListT<_TouchGestureDetector*>* pGestureList = GetCore().GetGestureDetectorList();
-                       if (pGestureList)
-                       {
-                               IEnumeratorT<_TouchGestureDetector*>* pEnumerator = pGestureList->GetEnumeratorN();
-                               SysTryReturnVoidResult(NID_UI, pEnumerator, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
-
-                               while (pEnumerator->MoveNext() == E_SUCCESS)
-                               {
-                                       _TouchGestureDetector* pGestureDetector = null;
-                                       pEnumerator->GetCurrent(pGestureDetector);
-                                       if (pGestureDetector)
-                                       {
-                                               gestureDetecting = true;
-                                               break;
-                                       }
-                               }
-
-                               delete pEnumerator;
-                       }
-
-                       if (!gestureDetecting)
-                       {
-                               pTouchManager->SetTouchCanceled(null);
-                       }
-               }
-       }
-
        GetCore().OnVisibleStateChanged();
 }