From 16ab3a36a34085d50495ebf7ccdddd272b3b3ddf Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Thu, 13 Jun 2024 18:07:11 +0900 Subject: [PATCH] If USER_INTERACTION_ENABLED is false, actor should not receive events. Change-Id: I21ca9b8587dfecf7412d6dff736f0bbcbc9b8bed --- 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, 6 insertions(+), 8 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp index 0e0793f..0e3d525 100644 --- a/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-GeoTouchProcessing.cpp @@ -892,10 +892,9 @@ int UtcDaliGeoTouchEventActorBecomesUserInteractionDisabled(void) // Change actor to disable user interaction. actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, false); - // Emit a motion signal, signalled with an interrupted + // Emit a motion signal, shouldn't receive a signal. application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(200.0f, 200.0f))); - DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION); - DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION); + DALI_TEST_EQUALS(false, data.functorCalled, 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 8b68383..b0a1fc6 100644 --- a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp @@ -991,10 +991,9 @@ int UtcDaliTouchEventActorBecomesUserInteractionDisabled(void) // Change actor to disable user interaction. actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, false); - // Emit a motion signal, signalled with an interrupted + // Emit a motion signal, shouldn't receive a signal. application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(200.0f, 200.0f))); - DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION); - DALI_TEST_EQUALS(PointState::INTERRUPTED, data.receivedTouch.points[0].state, TEST_LOCATION); + DALI_TEST_EQUALS(false, data.functorCalled, 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 0c35355..a555a61 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() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion()); + return actorImpl.GetInterceptTouchRequired() && actorImpl.IsUserInteractionEnabled() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion()); } bool ShouldEmitTouchEvent(const Actor& actorImpl, const Dali::TouchEvent& event) { PointState::Type state = event.GetState(0); - return actorImpl.GetTouchRequired() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion()); + return actorImpl.GetTouchRequired() && actorImpl.IsUserInteractionEnabled() && (state != PointState::MOTION || actorImpl.IsDispatchTouchMotion()); } // child -> parent -- 2.7.4