Gesture is interrupted if even one of several views is consumed. 48/258748/5
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 25 May 2021 06:15:50 +0000 (15:15 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Thu, 15 Jul 2021 06:31:29 +0000 (06:31 +0000)
This is a problem for backward-compatibility.

So, I remove the code that interrupts Gesture when the touch event is consumed

Change-Id: I01379cffb8edbfa1b82cdb585c08517752f64335

automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp
automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp
automated-tests/src/dali/utc-Dali-RotationGestureDetector.cpp
automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp
dali/internal/event/events/event-processor.cpp
dali/public-api/actors/actor.h

index 983aefe..0909376 100644 (file)
@@ -994,49 +994,6 @@ int UtcDaliLongPressGestureSetMinimumHoldingTime(void)
   END_TEST;
 }
 
-int UtcDaliLongPressGestureInterruptedWhenTouchConsumed(void)
-{
-  TestApplication application;
-
-  Actor actor = Actor::New();
-  actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
-  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
-  application.GetScene().Add(actor);
-
-  bool                           consume = false;
-  TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData             data;
-  GestureReceivedFunctor functor(data);
-
-  LongPressGestureDetector detector = LongPressGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  // Start gesture within the actor's area, we should receive the gesture as the touch is NOT being consumed
-  TestGenerateLongPress(application, 50.0f, 50.0f);
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  data.Reset();
-  TestEndLongPress(application, 50.0f, 50.0f);
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  data.Reset();
-
-  // Another gesture in the same location, this time we will not receive it as touch is being consumed
-  consume = true;
-  TestGenerateLongPress(application, 50.0f, 50.0f);
-  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-  data.Reset();
-  TestEndLongPress(application, 50.0f, 50.0f);
-  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-
-  END_TEST;
-}
-
 int UtcDaliLongPressGestureDisableDetectionDuringLongPressN(void)
 {
   // Crash occurred when gesture-recognizer was deleted internally during a signal when the attached actor was detached
index 98019b2..713cffe 100644 (file)
@@ -2835,50 +2835,6 @@ int UtcDaliPanGestureNoTimeDiff(void)
   END_TEST;
 }
 
-int UtcDaliPanGestureInterruptedWhenTouchConsumed(void)
-{
-  TestApplication application;
-
-  Actor actor = Actor::New();
-  actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
-  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
-  application.GetScene().Add(actor);
-
-  bool                           consume = false;
-  TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData             data;
-  GestureReceivedFunctor functor(data);
-
-  PanGestureDetector detector = PanGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  // Start gesture within the actor's area, we should receive the pan as the touch is NOT being consumed
-  uint32_t time = 100;
-  TestStartPan(application, Vector2(10.0f, 20.0f), Vector2(26.0f, 20.0f), time);
-
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
-  data.Reset();
-
-  // Continue the gesture within the actor's area, but now the touch consumes thus cancelling the gesture
-  consume = true;
-
-  TestMovePan(application, Vector2(26.0f, 4.0f), time);
-  time += TestGetFrameInterval();
-
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(GestureState::CANCELLED, data.receivedGesture.GetState(), TEST_LOCATION);
-
-  END_TEST;
-}
-
 int UtcDaliPanGestureDisableDetectionDuringPanN(void)
 {
   // Crash occurred when gesture-recognizer was deleted internally during a signal when the attached actor was detached
index e746f73..8547f00 100644 (file)
@@ -1056,53 +1056,6 @@ int UtcDaliPinchGestureLayerConsumesTouch(void)
   END_TEST;
 }
 
-int UtcDaliPinchGestureInterruptedWhenTouchConsumed(void)
-{
-  TestApplication application;
-
-  Actor actor = Actor::New();
-  actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
-  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
-  application.GetScene().Add(actor);
-
-  bool                           consume = false;
-  TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData             data;
-  GestureReceivedFunctor functor(data);
-
-  PinchGestureDetector detector = PinchGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  // Start gesture within the actor's area, we should receive the pinch as the touch is NOT being consumed
-  TestStartPinch(application, Vector2(2.0f, 20.0f), Vector2(38.0f, 20.0f), Vector2(10.0f, 20.0f), Vector2(30.0f, 20.0f), 100);
-
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
-  data.Reset();
-
-  // Continue the gesture within the actor's area, but now the touch consumes thus cancelling the gesture
-  consume = true;
-
-  TestContinuePinch(application, Vector2(112.0f, 100.0f), Vector2(112.0f, 124.0f), Vector2(5.0f, 5.0f), Vector2(35.0f, 35.0f), 200);
-
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(GestureState::CANCELLED, data.receivedGesture.GetState(), TEST_LOCATION);
-  data.Reset();
-
-  // Start another pinch, we should not even get the callback this time
-  TestStartPinch(application, Vector2(2.0f, 20.0f), Vector2(38.0f, 20.0f), Vector2(10.0f, 20.0f), Vector2(30.0f, 20.0f), 100);
-  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-
-  END_TEST;
-}
-
 int UtcDaliPinchGestureDisableDetectionDuringPinchN(void)
 {
   // Crash sometimes occurred when gesture-recognizer was deleted internally during a signal when the attached actor was detached
index 2fa5aec..65744de 100644 (file)
@@ -1045,52 +1045,6 @@ int UtcDaliRotationGestureLayerConsumesTouch(void)
   END_TEST;
 }
 
-int UtcDaliRotationGestureInterruptedWhenTouchConsumed(void)
-{
-  TestApplication application;
-
-  Actor actor = Actor::New();
-  actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
-  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
-  application.GetScene().Add(actor);
-
-  bool                           consume = false;
-  TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData             data;
-  GestureReceivedFunctor functor(data);
-
-  RotationGestureDetector detector = RotationGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  // Start gesture within the actor's area, we should receive the rotation as the touch is NOT being consumed
-  TestStartRotation(application, Vector2(2.0f, 20.0f), Vector2(38.0f, 20.0f), Vector2(10.0f, 20.0f), Vector2(30.0f, 20.0f), 100);
-
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(GestureState::STARTED, data.receivedGesture.GetState(), TEST_LOCATION);
-  data.Reset();
-
-  // Continue the gesture within the actor's area, but now the touch consumes thus cancelling the gesture
-  consume = true;
-
-  TestContinueRotation(application, Vector2(10.0f, 20.0f), Vector2(30.0f, 20.0f), Vector2(15.0f, 20.0f), Vector2(25.0f, 20.0f), 500);
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(GestureState::CANCELLED, data.receivedGesture.GetState(), TEST_LOCATION);
-  data.Reset();
-
-  // Start another rotation, we should not even get the callback this time
-  TestStartRotation(application, Vector2(2.0f, 20.0f), Vector2(38.0f, 20.0f), Vector2(10.0f, 20.0f), Vector2(30.0f, 20.0f), 100);
-  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-
-  END_TEST;
-}
-
 int UtcDaliRotationGestureDisableDetectionDuringRotationN(void)
 {
   // Crash sometimes occurred when gesture-recognizer was deleted internally during a signal when the attached actor was detached
index 7f79a5c..a05941a 100644 (file)
@@ -927,44 +927,6 @@ int UtcDaliTapGestureLayerConsumesTouch(void)
   END_TEST;
 }
 
-int UtcDaliTapGestureInterruptedWhenTouchConsumed(void)
-{
-  TestApplication application;
-
-  Actor actor = Actor::New();
-  actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
-  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
-  application.GetScene().Add(actor);
-
-  bool                           consume = false;
-  TouchEventFunctorConsumeSetter touchFunctor(consume);
-  actor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData             data;
-  GestureReceivedFunctor functor(data);
-
-  TapGestureDetector detector = TapGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  // Start gesture within the actor's area, we should receive the gesture as the touch is NOT being consumed
-  TestGenerateTap(application, 50.0f, 50.0f);
-  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  data.Reset();
-
-  // Another gesture in the same location, this time we will not receive it as touch is being consumed
-  consume = true;
-  TestGenerateTap(application, 50.0f, 50.0f);
-  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-  data.Reset();
-
-  END_TEST;
-}
-
 int UtcDaliTapGestureDisableDetectionDuringTapN(void)
 {
   // Crash sometimes occurred when gesture-recognizer was deleted internally during a signal when the attached actor was detached
index 34361e5..44d9eef 100644 (file)
@@ -150,15 +150,7 @@ void EventProcessor::ProcessEvents()
       case Event::Touch:
       {
         Integration::TouchEvent& touchEvent = static_cast<Integration::TouchEvent&>(*event);
-        const bool               consumed   = mTouchEventProcessor.ProcessTouchEvent(touchEvent);
-
-        // If touch is consumed, then gestures should be cancelled
-        // Do this by sending an interrupted event to the GestureEventProcessor
-        if(consumed)
-        {
-          Integration::Point& point = touchEvent.GetPoint(0);
-          point.SetState(PointState::INTERRUPTED);
-        }
+        mTouchEventProcessor.ProcessTouchEvent(touchEvent);
 
         mGestureEventProcessor.ProcessTouchEvent(mScene, touchEvent);
         break;
index 730d28b..f4d4b3e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ACTOR_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1166,7 +1166,6 @@ public: // Signals
    * @endcode
    * The return value of True, indicates that the touch event has been consumed.
    * Otherwise the signal will be emitted on the next sensitive parent of the actor.
-   * A true return will also cancel any ongoing gestures.
    * @SINCE_1_9.28
    * @return The signal to connect to
    * @pre The Actor has been initialized.