If USER_INTERACTION_ENABLED is false, actor should not receive events. 18/312718/1
authorjoogab.yun <joogab.yun@samsung.com>
Thu, 13 Jun 2024 09:07:11 +0000 (18:07 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Thu, 13 Jun 2024 09:07:11 +0000 (18:07 +0900)
Change-Id: I21ca9b8587dfecf7412d6dff736f0bbcbc9b8bed

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

index 0e0793f..0e3d525 100644 (file)
@@ -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;
 }
index 8b68383..b0a1fc6 100644 (file)
@@ -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;
 }
index 0c35355..a555a61 100644 (file)
@@ -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