From 951338aa0023da19e5e385a0fd11b35584a6136c Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Mon, 8 Jan 2024 10:44:16 +0900 Subject: [PATCH] Touch and Hover event propagrated by geometry way.(4) 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 | 4 ++-- dali/internal/event/events/touch-event-processor.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp index dbc6165..43944be 100644 --- a/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp @@ -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(); diff --git a/dali/internal/event/events/touch-event-processor.cpp b/dali/internal/event/events/touch-event-processor.cpp index 9472226..fabbcab 100644 --- a/dali/internal/event/events/touch-event-processor.cpp +++ b/dali/internal/event/events/touch-event-processor.cpp @@ -104,12 +104,17 @@ Dali::Actor EmitInterceptTouchSignals(Dali::Actor actor, const Dali::TouchEvent& // geometry // child -> below -Dali::Actor EmitGeoInterceptTouchSignals(std::list& actorLists, std::list& interceptActorList, const Dali::TouchEvent& touchEvent) +Dali::Actor EmitGeoInterceptTouchSignals(std::list& actorLists, std::list& 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)); -- 2.7.4