From c8823a59943102f902111bca7bf86942d713b9dd Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Thu, 20 Jun 2024 10:02:48 +0900 Subject: [PATCH] If Hittable is false, actor should not receive events except INTERRUPTED Change-Id: I6f782f0e3021ea1d3bcc8a9ce630956bd2128fda --- automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp | 5 +++-- automated-tests/src/dali/utc-Dali-TouchProcessing.cpp | 5 +++-- dali/internal/event/events/touch-event-processor.cpp | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp index 4ab68a7..40f4afc 100644 --- a/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp @@ -892,9 +892,10 @@ int UtcDaliGeoTouchEventActorBecomesUserInteractionDisabled(void) // Change actor to disable user interaction. actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, false); - // Emit a motion signal, shouldn't receive a signal. + // Emit a motion signal, signalled with an interrupted application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(200.0f, 200.0f))); - DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION); + DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION); + DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION); data.Reset(); END_TEST; } diff --git a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp index b0a1fc6..8b68383 100644 --- a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp @@ -991,9 +991,10 @@ int UtcDaliTouchEventActorBecomesUserInteractionDisabled(void) // Change actor to disable user interaction. actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, false); - // Emit a motion signal, shouldn't receive a signal. + // Emit a motion signal, signalled with an interrupted application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(200.0f, 200.0f))); - DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION); + DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION); + DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION); data.Reset(); END_TEST; } diff --git a/dali/internal/event/events/touch-event-processor.cpp b/dali/internal/event/events/touch-event-processor.cpp index 21a41d8..44792ef 100644 --- a/dali/internal/event/events/touch-event-processor.cpp +++ b/dali/internal/event/events/touch-event-processor.cpp @@ -83,13 +83,13 @@ const char* TOUCH_POINT_STATE[6] = bool ShouldEmitInterceptTouchEvent(const Actor& actorImpl, const Dali::TouchEvent& event) { PointState::Type state = event.GetState(0); - return actorImpl.GetInterceptTouchRequired() && actorImpl.IsUserInteractionEnabled() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion()); + return actorImpl.GetInterceptTouchRequired() && (actorImpl.IsHittable() || state == PointState::INTERRUPTED ) && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion()); } bool ShouldEmitTouchEvent(const Actor& actorImpl, const Dali::TouchEvent& event) { PointState::Type state = event.GetState(0); - return actorImpl.GetTouchRequired() && actorImpl.IsUserInteractionEnabled() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion()); + return actorImpl.GetTouchRequired() && (actorImpl.IsHittable() || state == PointState::INTERRUPTED ) && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion()); } // child -> parent -- 2.7.4