From: joogab.yun Date: Thu, 13 Jun 2024 09:07:11 +0000 (+0900) Subject: If USER_INTERACTION_ENABLED is false, actor should not receive events. X-Git-Tag: dali_2.3.29~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16ab3a36a34085d50495ebf7ccdddd272b3b3ddf;p=platform%2Fcore%2Fuifw%2Fdali-core.git If USER_INTERACTION_ENABLED is false, actor should not receive events. Change-Id: I21ca9b8587dfecf7412d6dff736f0bbcbc9b8bed --- 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