Revert "[Tizen] INTERRUPTED events are divided into touch and hover."
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 25 Oct 2023 07:35:32 +0000 (16:35 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 25 Oct 2023 07:35:32 +0000 (16:35 +0900)
This reverts commit c303b8948559dfd26d4206e1432133d70d655a1e.

automated-tests/src/dali/utc-Dali-TouchEventCombiner.cpp
dali/integration-api/events/touch-event-combiner.cpp

index 8c8fc30..f9664c4 100644 (file)
@@ -835,45 +835,9 @@ int UtcDaliTouchEventCombinerSingleTouchInterrupted(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point      point = GeneratePoint(1, PointState::INTERRUPTED, 100.0f, 100.0f);
 
-    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
+    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_BOTH, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
     DALI_TEST_EQUALS(touchEvent.GetPointCount(), 1u, TEST_LOCATION);
     DALI_TEST_EQUALS(touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION);
-  }
-
-  // Send up, should not be able to send as combiner has been reset.
-  // Up event
-  {
-    Integration::TouchEvent touchEvent;
-    Integration::HoverEvent hoverEvent;
-    Integration::Point      point = GeneratePoint(1, PointState::UP, 100.0f, 100.0f);
-
-    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
-  }
-
-  // motion event for hover
-  {
-    Integration::TouchEvent touchEvent;
-    Integration::HoverEvent hoverEvent;
-    Integration::Point      point = GeneratePoint(1, PointState::MOTION, 100.0f, 100.0f);
-    point.SetDeviceClass(Device::Class::Type::MOUSE);
-
-    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
-    DALI_TEST_EQUALS(hoverEvent.GetPointCount(), 1u, TEST_LOCATION);
-    DALI_TEST_EQUALS(hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION);
-    DALI_TEST_EQUALS(hoverEvent.points[0].GetState(), PointState::STARTED, TEST_LOCATION);
-    DALI_TEST_EQUALS(hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION);
-  }
-
-  time++;
-
-  // Interrupted event
-  {
-    Integration::TouchEvent touchEvent;
-    Integration::HoverEvent hoverEvent;
-    Integration::Point      point = GeneratePoint(1, PointState::INTERRUPTED, 100.0f, 100.0f);
-    point.SetDeviceClass(Device::Class::Type::MOUSE);
-
-    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
     DALI_TEST_EQUALS(hoverEvent.GetPointCount(), 1u, TEST_LOCATION);
     DALI_TEST_EQUALS(hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION);
   }
@@ -913,41 +877,9 @@ int UtcDaliTouchEventCombinerMultiTouchInterrupted(void)
     Integration::HoverEvent hoverEvent;
     Integration::Point      point = GeneratePoint(1, PointState::INTERRUPTED, 100.0f, 100.0f);
 
-    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
+    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_BOTH, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
     DALI_TEST_EQUALS(touchEvent.GetPointCount(), 1u, TEST_LOCATION);
     DALI_TEST_EQUALS(touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION);
-  }
-
-  // Send up, should not be able to send as combiner has been reset.
-  // Up event
-  {
-    Integration::TouchEvent touchEvent;
-    Integration::HoverEvent hoverEvent;
-    Integration::Point      point = GeneratePoint(1, PointState::UP, 100.0f, 100.0f);
-
-    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
-  }
-
-  // Several motion for hover
-  for(unsigned int pointCount = 1u; pointCount < maximum; ++pointCount)
-  {
-    Integration::TouchEvent touchEvent;
-    Integration::HoverEvent hoverEvent;
-    Integration::Point      point = GeneratePoint(pointCount, PointState::MOTION, 100.0f, 100.0f);
-    point.SetDeviceClass(Device::Class::Type::MOUSE);
-
-    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
-    DALI_TEST_EQUALS(hoverEvent.GetPointCount(), pointCount, TEST_LOCATION);
-  }
-
-  // Interrupted event
-  {
-    Integration::TouchEvent touchEvent;
-    Integration::HoverEvent hoverEvent;
-    Integration::Point      point = GeneratePoint(1, PointState::INTERRUPTED, 100.0f, 100.0f);
-    point.SetDeviceClass(Device::Class::Type::MOUSE);
-
-    DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
     DALI_TEST_EQUALS(hoverEvent.GetPointCount(), 1u, TEST_LOCATION);
     DALI_TEST_EQUALS(hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION);
   }
index 4f01dfd..7423590 100644 (file)
@@ -336,18 +336,12 @@ TouchEventCombiner::EventDispatchType TouchEventCombiner::GetNextTouchEvent(cons
 
     case PointState::INTERRUPTED:
     {
-      // We should still tell core about the interruption.
-      if(!mPressedPoints.empty())
-      {
-        touchEvent.AddPoint(point);
-        dispatchEvent = TouchEventCombiner::DISPATCH_TOUCH;
-      }
-      if((!mHoveredPoints.empty()))
-      {
-        hoverEvent.AddPoint(point);
-        dispatchEvent = dispatchEvent == TouchEventCombiner::DISPATCH_TOUCH ? TouchEventCombiner::DISPATCH_BOTH : TouchEventCombiner::DISPATCH_HOVER;
-      }
       Reset();
+
+      // We should still tell core about the interruption.
+      touchEvent.AddPoint(point);
+      hoverEvent.AddPoint(point);
+      dispatchEvent = TouchEventCombiner::DISPATCH_BOTH;
       break;
     }