Touch and Hover event propagrated by geometry way.(3)
[platform/core/uifw/dali-core.git] / dali / internal / event / events / touch-event-processor.cpp
index 9a139f5..9472226 100644 (file)
@@ -493,18 +493,21 @@ bool TouchEventProcessor::ProcessTouchEvent(const Integration::TouchEvent& event
   {
     if(isGeometry)
     {
-      Actor* touchConsumedActor(mLastConsumedActor.GetActor());
       Actor* interceptedTouchActor(mInterceptedTouchActor.GetActor());
-      if(touchConsumedActor) // If there is a consultative actor, send events only to the consultative actor.
-      {
-        RenderTask& currentRenderTaskImpl = *currentRenderTask.Get();
-        consumedActor = EmitTouchSignals(touchConsumedActor, currentRenderTaskImpl, touchEventImpl, primaryPointState, isGeometry);
-      }
-      else if(interceptedTouchActor) // If there is an intercepted actor, send a touch event starting from the intercepted actor.
+      if(interceptedTouchActor)
       {
-        Dali::Actor interceptedTouchActorHandle(interceptedTouchActor);
-        std::list<Dali::Internal::Actor*> interceptActorLists = mInterceptedActorLists;
-        consumedActor = EmitGeoTouchSignals(interceptActorLists, touchEventHandle);
+        Actor* touchConsumedActor(mLastConsumedActor.GetActor());
+        if(touchConsumedActor) // If there is a consumed actor, send events only to the consumed actor.
+        {
+          RenderTask& currentRenderTaskImpl = *currentRenderTask.Get();
+          consumedActor = EmitTouchSignals(touchConsumedActor, currentRenderTaskImpl, touchEventImpl, primaryPointState, isGeometry);
+        }
+        else // If there is an intercepted actor, send a touch event starting from the intercepted actor.
+        {
+          Dali::Actor interceptedTouchActorHandle(interceptedTouchActor);
+          std::list<Dali::Internal::Actor*> interceptActorLists = mInterceptedActorLists;
+          consumedActor = EmitGeoTouchSignals(interceptActorLists, touchEventHandle);
+        }
       }
       else
       {
@@ -530,22 +533,26 @@ bool TouchEventProcessor::ProcessTouchEvent(const Integration::TouchEvent& event
                   mLastRenderTask &&
                   mLastPrimaryPointState != PointState::FINISHED)
           {
-            std::list<Dali::Internal::Actor*> internalActorLists = mCandidateActorLists;
-            while(!internalActorLists.empty())
+            std::list<Dali::Internal::Actor*>::reverse_iterator rIter = mCandidateActorLists.rbegin();
+            for (; rIter != mCandidateActorLists.rend(); rIter++)
             {
-              Actor* actorImpl = internalActorLists.back();
-              // Only emit the signal if the actor's touch signal has connections (or derived actor implementation requires touch).
-              if(actorImpl->GetTouchRequired())
-              {
-                EmitTouchSignals(actorImpl, *mLastRenderTask.Get(), touchEventImpl, PointState::INTERRUPTED, isGeometry);
-              }
-              internalActorLists.pop_back();
+              Actor* actorImpl(*rIter);
+              EmitTouchSignals(actorImpl, *mLastRenderTask.Get(), touchEventImpl, PointState::INTERRUPTED, isGeometry);
             }
           }
         }
 
-        // Let's propagate touch events from the intercepted actor or start propagating touch events from the leaf actor.
-        consumedActor = EmitGeoTouchSignals(interceptedActor ? mInterceptedActorLists : mCandidateActorLists, touchEventHandle);
+        Actor* touchConsumedActor(mLastConsumedActor.GetActor());
+        if(touchConsumedActor) // If there is a consumed actor, send events only to the consumed actor.
+        {
+          RenderTask& currentRenderTaskImpl = *currentRenderTask.Get();
+          consumedActor = EmitTouchSignals(touchConsumedActor, currentRenderTaskImpl, touchEventImpl, primaryPointState, isGeometry);
+        }
+        else
+        {
+          // Let's propagate touch events from the intercepted actor or start propagating touch events from the leaf actor.
+          consumedActor = EmitGeoTouchSignals(interceptedActor ? mInterceptedActorLists : mCandidateActorLists, touchEventHandle);
+        }
       }
     }
     else