Touch and Hover event propagrated by geometry way.(4) 02/303902/2
authorjoogab.yun <joogab.yun@samsung.com>
Mon, 8 Jan 2024 01:44:16 +0000 (10:44 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Mon, 8 Jan 2024 01:57:53 +0000 (10:57 +0900)
If there is a consumed actor, the intercept is sent only up to the moment before the consumed actor.

Change-Id: I35f174fe4c6845fc36392ba3cc3cd35c839471fc

automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp
dali/internal/event/events/touch-event-processor.cpp

index dbc6165189e048655c437a74997c92e48de8a94a..43944be5489f7880ed042034fbb8229e817aabec 100644 (file)
@@ -2197,7 +2197,7 @@ int UtcDaliGeoTouchEventIntercept04(void)
 
   // Connect to actor's touched signal
   SignalData        data;
-  TouchEventFunctor functor(data, false /* Do not consume */);
+  TouchEventFunctor functor(data); // consume
   actor.TouchedSignal().Connect(&application, functor);
 
   // Connect to parent's touched signal
@@ -2230,7 +2230,7 @@ int UtcDaliGeoTouchEventIntercept04(void)
   DALI_TEST_CHECK(parent == interceptData.touchedActor);
   DALI_TEST_EQUALS(true, parentData.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(PointState::DOWN, parentData.receivedTouch.points[0].state, TEST_LOCATION);
-  DALI_TEST_CHECK(parent == parentData.receivedTouch.points[0].hitActor);
+  DALI_TEST_CHECK(actor == parentData.receivedTouch.points[0].hitActor);
   DALI_TEST_CHECK(parent == parentData.touchedActor);
   data.Reset();
   interceptData.Reset();
index 94722266c3e7da852e7ec78e8987e8e9a85c7ffb..fabbcabb0b6261fa5822e39fb04d8bab4553ceec 100644 (file)
@@ -104,12 +104,17 @@ Dali::Actor EmitInterceptTouchSignals(Dali::Actor actor, const Dali::TouchEvent&
 
 // geometry
 // child -> below
-Dali::Actor EmitGeoInterceptTouchSignals(std::list<Dali::Internal::Actor*>& actorLists, std::list<Dali::Internal::Actor*>& interceptActorList, const Dali::TouchEvent& touchEvent)
+Dali::Actor EmitGeoInterceptTouchSignals(std::list<Dali::Internal::Actor*>& actorLists, std::list<Dali::Internal::Actor*>& interceptActorList, const Dali::TouchEvent& touchEvent, ActorObserver& lastConsumedActor)
 {
   interceptActorList.clear();
   Dali::Actor interceptedActor;
   for(auto&& actor : actorLists)
   {
+    // If there is a consumed actor, the intercept is sent only up to the moment before the consumed actor.
+    if(lastConsumedActor.GetActor() == actor)
+    {
+        break;
+    }
     interceptActorList.push_back(actor);
     if(ShouldEmitInterceptTouchEvent(*actor, touchEvent))
     {
@@ -513,7 +518,7 @@ bool TouchEventProcessor::ProcessTouchEvent(const Integration::TouchEvent& event
       {
         Dali::Actor interceptedActor;
         // Let's find out if there is an intercept actor.
-        interceptedActor = EmitGeoInterceptTouchSignals(mCandidateActorLists, mInterceptedActorLists, touchEventHandle);
+        interceptedActor = EmitGeoInterceptTouchSignals(mCandidateActorLists, mInterceptedActorLists, touchEventHandle, mLastConsumedActor);
         if(interceptedActor)
         {
           mInterceptedTouchActor.SetActor(&GetImplementation(interceptedActor));