For Frame Event 05/311805/18
authorjoogab.yun <joogab.yun@samsung.com>
Tue, 28 May 2024 07:12:46 +0000 (16:12 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Thu, 20 Jun 2024 00:07:47 +0000 (09:07 +0900)
When processing multiple multi-touches, they are grouped and processed.
Group multi-touch events and process them when a frame event occurs.

Change-Id: I1e3ac2a0026f3f95910b53521f3ddd8c6108de3c

17 files changed:
dali/integration-api/adaptor-framework/scene-holder-impl.cpp
dali/integration-api/adaptor-framework/scene-holder-impl.h
dali/internal/window-system/common/event-handler.cpp
dali/internal/window-system/common/event-handler.h
dali/internal/window-system/common/gl-window-impl.cpp
dali/internal/window-system/common/gl-window-impl.h
dali/internal/window-system/common/window-base.cpp
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/macos/window-base-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/x11/window-base-x.cpp

index 011b87fd8b6322040f71debd1d514fdae88c3961..d5e1cf17c9d14dd77cade69d424fdf34bb25d5c5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -49,6 +49,8 @@ namespace
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gSceneHolderLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_SCENE_HOLDER");
 #endif
+
+const uint32_t MAX_PRESSED_POINT_COUNT = 2;
 } // unnamed namespace
 
 uint32_t SceneHolder::mSceneHolderCounter = 0;
@@ -93,7 +95,11 @@ SceneHolder::SceneHolder()
   mAdaptor(nullptr),
   mDpi(),
   mAdaptorStarted(false),
-  mVisible(true)
+  mVisible(true),
+  mHandledMultiTouch(false),
+  mPreviousTouchEvent(),
+  mPreviousHoverEvent(),
+  mPreviousType(Integration::TouchEventCombiner::DISPATCH_NONE)
 {
 }
 
@@ -316,13 +322,12 @@ void SceneHolder::FeedTouchPoint(Dali::Integration::Point& point, int timeStamp)
   {
     timeStamp = TimeService::GetMilliSeconds();
   }
-
   Vector2 convertedPosition = RecalculatePosition(point.GetScreenPosition());
   point.SetScreenPosition(convertedPosition);
 
   Integration::TouchEvent                            touchEvent;
   Integration::HoverEvent                            hoverEvent;
-  Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
+  Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent, mHandledMultiTouch);
   if(type != Integration::TouchEventCombiner::DISPATCH_NONE)
   {
     DALI_LOG_INFO(gSceneHolderLogFilter, Debug::Verbose, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y);
@@ -331,22 +336,78 @@ void SceneHolder::FeedTouchPoint(Dali::Integration::Point& point, int timeStamp)
     // Keep the handle alive until the core events are processed.
     Dali::BaseHandle sceneHolder(this);
 
-    // First the touch and/or hover event & related gesture events are queued
+    uint32_t pointCount = touchEvent.GetPointCount();
+    if(pointCount > MAX_PRESSED_POINT_COUNT)
+    {
+      mPreviousTouchEvent = touchEvent;
+      mPreviousHoverEvent = hoverEvent;
+      if(mPreviousType == Integration::TouchEventCombiner::DISPATCH_NONE)
+      {
+        mPreviousType = type;
+      }
+      else if(mPreviousType != type)
+      {
+        mPreviousType = Integration::TouchEventCombiner::DISPATCH_BOTH;
+      }
+      mHandledMultiTouch = true;
+    }
+
     if(type == Integration::TouchEventCombiner::DISPATCH_TOUCH || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
     {
       mLastTouchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
-      mScene.QueueEvent(touchEvent);
     }
 
     if(type == Integration::TouchEventCombiner::DISPATCH_HOVER || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
     {
       mLastHoverEvent = Dali::Integration::NewHoverEvent(timeStamp, point);
-      mScene.QueueEvent(hoverEvent);
     }
 
     // Next the events are processed with a single call into Core
+    if(pointCount <= MAX_PRESSED_POINT_COUNT || (point.GetState() != PointState::MOTION))
+    {
+      mHandledMultiTouch = false;
+      mPreviousType      = Integration::TouchEventCombiner::DISPATCH_NONE;
+
+      // First the touch and/or hover event & related gesture events are queued
+      if(type == Integration::TouchEventCombiner::DISPATCH_TOUCH || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
+      {
+        mScene.QueueEvent(touchEvent);
+      }
+
+      if(type == Integration::TouchEventCombiner::DISPATCH_HOVER || type == Integration::TouchEventCombiner::DISPATCH_BOTH)
+      {
+        mScene.QueueEvent(hoverEvent);
+      }
+      mAdaptor->ProcessCoreEvents();
+    }
+  }
+}
+
+void SceneHolder::FeedMouseFrameEvent()
+{
+  if(DALI_UNLIKELY(!mAdaptorStarted))
+  {
+    DALI_LOG_ERROR("Adaptor is stopped, or not be started yet. Ignore this feed.\n");
+    return;
+  }
+
+  if(mPreviousType == Integration::TouchEventCombiner::DISPATCH_TOUCH || mPreviousType == Integration::TouchEventCombiner::DISPATCH_BOTH)
+  {
+    mScene.QueueEvent(mPreviousTouchEvent);
+  }
+
+  if(mPreviousType == Integration::TouchEventCombiner::DISPATCH_HOVER || mPreviousType == Integration::TouchEventCombiner::DISPATCH_BOTH)
+  {
+    mScene.QueueEvent(mPreviousHoverEvent);
+  }
+
+  if(mPreviousType != Integration::TouchEventCombiner::DISPATCH_NONE)
+  {
     mAdaptor->ProcessCoreEvents();
   }
+
+  mHandledMultiTouch = false;
+  mPreviousType      = Integration::TouchEventCombiner::DISPATCH_NONE;
 }
 
 const Dali::TouchEvent& SceneHolder::GetLastTouchEvent() const
@@ -489,6 +550,8 @@ void SceneHolder::Reset()
   mScene.QueueEvent(event);
 
   // Next the events are processed with a single call into Core
+  mHandledMultiTouch = false;
+  mPreviousType      = Integration::TouchEventCombiner::DISPATCH_NONE;
   mAdaptor->ProcessCoreEvents();
 }
 
index 144bc13475ea91753995cda3bafe03552417dbea..0d984eccbf372351e92ebbecbe57e614b76fdbd0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_INTERNAL_SCENEHOLDER_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -24,6 +24,7 @@
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/point.h>
 #include <dali/integration-api/events/touch-event-combiner.h>
+#include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/scene.h>
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/events/hover-event.h>
@@ -181,6 +182,11 @@ public:
    */
   void FeedTouchPoint(Dali::Integration::Point& point, int timeStamp);
 
+  /**
+   * @copydoc Dali::Integration::SceneHolder::FeedMouseFrameEvent
+   */
+  void FeedMouseFrameEvent();
+
   /**
    * @brief Get the Last Touch Event
    *
@@ -412,8 +418,12 @@ protected:
 
   Uint16Pair mDpi; ///< The DPI for this SceneHolder.
 
-  bool mAdaptorStarted; ///< Whether the adaptor has started or not
-  bool mVisible : 1;    ///< Whether the scene is visible or not
+  bool                                               mAdaptorStarted; ///< Whether the adaptor has started or not
+  bool                                               mVisible : 1;    ///< Whether the scene is visible or not
+  bool                                               mHandledMultiTouch : 1;
+  Integration::TouchEvent                            mPreviousTouchEvent;
+  Integration::HoverEvent                            mPreviousHoverEvent;
+  Integration::TouchEventCombiner::EventDispatchType mPreviousType;
 };
 
 } // namespace Adaptor
index 66ee64abaa4a9eddce9729b3710b169d0a71baf8..4d29e74c6eea775f5b4cda30efa022ea00324d25 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -61,6 +61,7 @@ EventHandler::EventHandler(WindowBase* windowBase, DamageObserver& damageObserve
     windowBase->FocusChangedSignal().Connect(this, &EventHandler::OnFocusChanged);
     windowBase->RotationSignal().Connect(this, &EventHandler::OnRotation);
     windowBase->TouchEventSignal().Connect(this, &EventHandler::OnTouchEvent);
+    windowBase->MouseFrameEventSignal().Connect(this, &EventHandler::OnMouseFrameEvent);
     windowBase->WheelEventSignal().Connect(this, &EventHandler::OnWheelEvent);
     windowBase->KeyEventSignal().Connect(this, &EventHandler::OnKeyEvent);
     windowBase->SelectionDataSendSignal().Connect(this, &EventHandler::OnSelectionDataSend);
@@ -106,6 +107,14 @@ void EventHandler::OnTouchEvent(Integration::Point& point, uint32_t timeStamp)
   }
 }
 
+void EventHandler::OnMouseFrameEvent()
+{
+  for(ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter)
+  {
+    (*iter)->OnMouseFrameEvent();
+  }
+}
+
 void EventHandler::OnWheelEvent(Integration::WheelEvent& wheelEvent)
 {
   for(ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter)
index 98c868a274316f06272b4f9d61a01391e26125e3..70685f814cc72aceb762fac3d95775a6396dda65 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_HANDLER_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -68,6 +68,11 @@ public:
      */
     virtual void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) = 0;
 
+    /**
+     * @brief Deriving classes should override this to be notified when we receive a mouse frame event.
+     */
+    virtual void OnMouseFrameEvent() = 0;
+
     /**
      * Deriving classes should override this to be notified when we receive a wheel event.
      * @param[in] wheelEvent The wheel event
@@ -156,6 +161,11 @@ private:
    */
   void OnTouchEvent(Integration::Point& point, uint32_t timeStamp);
 
+  /**
+   * Called when a mouse frame event is received.
+   */
+  void OnMouseFrameEvent();
+
   /**
    * Called when a mouse wheel is received.
    */
index 4e993e093b89db9d30015d4ed991c319d2915f0a..3f5ce843fba0163328fe352537b45001fa138b4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -502,6 +502,10 @@ void GlWindow::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
   mTouchedSignal.Emit(touchEvent);
 }
 
+void GlWindow::OnMouseFrameEvent()
+{
+}
+
 void GlWindow::OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
 {
   // TODO:
index 7df776cd4f6ea0047b05f3f8c43fe3772ab3cfbd..46de8bb79b8d774abdbafb10bcff283790574778 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -311,6 +311,11 @@ private:
    */
   void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnMouseFrameEvent
+   */
+  void OnMouseFrameEvent() override;
+
   /**
    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
    */
index a2ff543b439ec458f2c9c2b3d7d22eaa0a51fd5a..a067d9b7fa0293903c2691d370439e6e62839841 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -33,6 +33,7 @@ WindowBase::WindowBase()
   mWindowDamagedSignal(),
   mRotationSignal(),
   mTouchEventSignal(),
+  mMouseFrameEventSignal(),
   mWheelEventSignal(),
   mKeyEventSignal(),
   mSelectionDataSendSignal(),
@@ -95,6 +96,11 @@ WindowBase::TouchEventSignalType& WindowBase::TouchEventSignal()
   return mTouchEventSignal;
 }
 
+WindowBase::MouseFrameEventSignalType& WindowBase::MouseFrameEventSignal()
+{
+  return mMouseFrameEventSignal;
+}
+
 WindowBase::WheelEventSignalType& WindowBase::WheelEventSignal()
 {
   return mWheelEventSignal;
index 7774da31e1b6b6952515c23945d59481f8e9ff11..c46ff1749f1faf513ecfd08bf037c21d8963b29f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -85,6 +85,7 @@ public:
 
   // Input events
   typedef Signal<void(Integration::Point&, uint32_t)> TouchEventSignalType;
+  typedef Signal<void()>                              MouseFrameEventSignalType;
   typedef Signal<void(Integration::WheelEvent&)>      WheelEventSignalType;
   typedef Signal<void(Integration::KeyEvent&)>        KeyEventSignalType;
 
@@ -553,7 +554,7 @@ public:
    */
   virtual void SetFrontBufferRendering(bool enable) = 0;
 
-    /**
+  /**
    * @brief Enables or disables front buffer rendering.
    * @return Returns whether front buffer rendering has been enabled or not.
    */
@@ -607,6 +608,11 @@ public:
    */
   TouchEventSignalType& TouchEventSignal();
 
+  /**
+   * @brief This signal is emitted when a mouse frame event is received.
+   */
+  MouseFrameEventSignalType& MouseFrameEventSignal();
+
   /**
    * @brief This signal is emitted when a mouse wheel is received.
    */
@@ -708,6 +714,7 @@ protected:
   DamageSignalType                        mWindowDamagedSignal;
   RotationSignalType                      mRotationSignal;
   TouchEventSignalType                    mTouchEventSignal;
+  MouseFrameEventSignalType               mMouseFrameEventSignal;
   WheelEventSignalType                    mWheelEventSignal;
   KeyEventSignalType                      mKeyEventSignal;
   SelectionSignalType                     mSelectionDataSendSignal;
index 8ea3b47889648156f3d70a28b11a624106cb6bb9..69e365f76f2d15f0820b9d085584801d27fbda88 100644 (file)
@@ -1122,6 +1122,11 @@ void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
   FeedTouchPoint(point, timeStamp);
 }
 
+void Window::OnMouseFrameEvent()
+{
+  FeedMouseFrameEvent();
+}
+
 void Window::OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
 {
   FeedWheelEvent(wheelEvent);
index 857bd4d3a08fd5ac21d83edda0d34c5ab64ee7cd..b0298a3a64df80f66251803856726f12523a04d1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -822,6 +822,11 @@ private: // Dali::Internal::Adaptor::EventHandler::Observer
    */
   void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnMouseFrameEvent
+   */
+  void OnMouseFrameEvent() override;
+
   /**
    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
    */
@@ -1024,8 +1029,8 @@ private:
   bool mOpaqueState : 1;
   bool mWindowRotationAcknowledgement : 1;
   bool mFocused : 1;
-  bool mIsWindowRotating : 1;      ///< The window rotating flag.
-  bool mIsEnabledUserGeometry : 1; ///< The user geometry enable flag.
+  bool mIsWindowRotating : 1;            ///< The window rotating flag.
+  bool mIsEnabledUserGeometry : 1;       ///< The user geometry enable flag.
   bool mIsEmittedWindowCreatedEvent : 1; ///< The Window Created Event emit flag for accessibility.
   bool mIsFrontBufferRendering : 1;      ///< The Front Buffer Rendering state.
 };
index 674ef630e6329c3ba7e0979e6a991452e3cc30dd..1a1f24c5cd8800c6e2bd0b4ae8da1508983a3ef3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -231,6 +231,8 @@ void WindowBaseCocoa::Impl::OnMouse(NSEvent *event, PointState::Type state)
 
     // timestamp is given in seconds, the signal expects it in milliseconds
     mThis->mTouchEventSignal.Emit(point, event.timestamp * 1000);
+
+    mThis->mMouseFrameEventSignal.Emit();
   }
 }
 
index b39426090bb130a452f061b8715b83bbdce66e46..a134bdc99d79654b5087ee73502953546d0a5fdd 100644 (file)
@@ -844,6 +844,8 @@ void WindowBaseEcoreWl::OnMouseButtonDown(void* data, int type, void* event)
     point.SetDeviceSubclass(deviceSubclass);
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -870,6 +872,8 @@ void WindowBaseEcoreWl::OnMouseButtonUp(void* data, int type, void* event)
     point.SetDeviceSubclass(deviceSubclass);
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -896,6 +900,8 @@ void WindowBaseEcoreWl::OnMouseButtonMove(void* data, int type, void* event)
     point.SetDeviceSubclass(deviceSubclass);
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -924,6 +930,8 @@ void WindowBaseEcoreWl::OnMouseButtonCancel(void* data, int type, void* event)
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
 
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n");
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
index 7ebaa1d4fee00223f9eac00684ed630be022d7fb..cfa6b9d7067ed6a62cf6130ce5839cd6f254d978 100644 (file)
@@ -459,6 +459,19 @@ static Eina_Bool EcoreEventMouseButtonMove(void* data, int type, void* event)
 }
 
 #ifdef OVER_TIZEN_VERSION_8
+/**
+ * Called when a touch motion is received.
+ */
+static Eina_Bool EcoreEventMouseFrame(void* data, int type, void* event)
+{
+  WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+  if(windowBase)
+  {
+    windowBase->OnMouseFrame(data, type, event);
+  }
+  return ECORE_CALLBACK_PASS_ON;
+}
+
 /**
  * Called when a touch motion is received.
  */
@@ -1019,6 +1032,9 @@ void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool
 
   // Register pointer lock/unlock event
   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_POINTER_CONSTRAINTS, EcoreEventPointerConstraints, this));
+
+  // Register mouse frame events
+  mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_FRAME, EcoreEventMouseFrame, this));
 #endif
 
   // Register Mouse wheel events
@@ -1313,6 +1329,10 @@ void WindowBaseEcoreWl2::OnMouseButtonDown(void* data, int type, void* event)
     point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+    mMouseFrameEventSignal.Emit();
+#endif
   }
 }
 
@@ -1342,6 +1362,10 @@ void WindowBaseEcoreWl2::OnMouseButtonUp(void* data, int type, void* event)
     point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+    mMouseFrameEventSignal.Emit();
+#endif
   }
 }
 
@@ -1370,10 +1394,25 @@ void WindowBaseEcoreWl2::OnMouseButtonMove(void* data, int type, void* event)
     point.SetDeviceSubclass(deviceSubclass);
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+    mMouseFrameEventSignal.Emit();
+#endif
   }
 }
 
 #ifdef OVER_TIZEN_VERSION_8
+void WindowBaseEcoreWl2::OnMouseFrame(void* data, int type, void* event)
+{
+  Ecore_Event_Mouse_Frame* MouseFrameEvent = static_cast<Ecore_Event_Mouse_Frame*>(event);
+
+  if(MouseFrameEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
+  {
+    DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_FRAME");
+    mMouseFrameEventSignal.Emit();
+  }
+}
+
 void WindowBaseEcoreWl2::OnMouseButtonRelativeMove(void* data, int type, void* event)
 {
   Ecore_Event_Mouse_Relative_Move* relativeMoveEvent = static_cast<Ecore_Event_Mouse_Relative_Move*>(event);
@@ -1421,6 +1460,10 @@ void WindowBaseEcoreWl2::OnMouseButtonCancel(void* data, int type, void* event)
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
 
+#ifndef OVER_TIZEN_VERSION_8
+    mMouseFrameEventSignal.Emit();
+#endif
+
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n");
   }
 }
index 4ec38e0720094f826ded5ceb2004ddc9e0207552..1f0bbbacf8d122bacbce621df4626cf051137747 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_WINDOW_BASE_ECORE_WL2_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -105,6 +105,11 @@ public:
    */
   void OnMouseButtonMove(void* data, int type, void* event);
 
+  /**
+   * @brief Called when a mouse frame is received.
+   */
+  void OnMouseFrame(void* data, int type, void* event);
+
   /**
    * @brief Called when a touch motion is received.
    */
index fdcfa567790e4d08071cb5b63aaab30ddbef9050..c03087735ea82f1624a3226cf321a6c740ed6e2f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -475,6 +475,8 @@ void WindowBaseEcoreX::OnMouseButtonDown(void* data, int type, void* event)
     }
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -497,6 +499,8 @@ void WindowBaseEcoreX::OnMouseButtonUp(void* data, int type, void* event)
     }
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -515,6 +519,8 @@ void WindowBaseEcoreX::OnMouseButtonMove(void* data, int type, void* event)
     point.SetAngle(Degree(static_cast<float>(touchEvent->multi.angle)));
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
index 28f67a1835872537d520e2782c563362fd75d88d..19e9cea1ee3e1df2714dce8bd1d4d23c1f72d90c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -132,6 +132,8 @@ void WindowBaseWin::OnMouseButtonDown(int type, TWinEventInfo* event)
     point.SetAngle(Degree(touchEvent.multi.angle));
 
     mTouchEventSignal.Emit(point, touchEvent.timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -156,6 +158,8 @@ void WindowBaseWin::OnMouseButtonUp(int type, TWinEventInfo* event)
     point.SetAngle(Degree(touchEvent.multi.angle));
 
     mTouchEventSignal.Emit(point, touchEvent.timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -180,6 +184,8 @@ void WindowBaseWin::OnMouseButtonMove(int type, TWinEventInfo* event)
     point.SetAngle(Degree(touchEvent.multi.angle));
 
     mTouchEventSignal.Emit(point, touchEvent.timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
index da239ee8b03eeb3f3e6f400782c40de19b1705ab..e5fdce2c9e6ac4d35a80e0ca356f761ab0620d43 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -480,6 +480,8 @@ void WindowBaseX::OnMouseButtonDown(void* data, WindowSystemBase::Event type, Wi
     }
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -503,6 +505,8 @@ void WindowBaseX::OnMouseButtonUp(void* data, WindowSystemBase::Event type, Wind
     }
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }
 
@@ -521,6 +525,8 @@ void WindowBaseX::OnMouseButtonMove(void* data, WindowSystemBase::Event type, Wi
     point.SetAngle(Degree(static_cast<float>(touchEvent->multi.angle)));
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+    mMouseFrameEventSignal.Emit();
   }
 }