From 8d5140be2417db8e517d222df7674b56fa0e2452 Mon Sep 17 00:00:00 2001 From: Taehyub Kim Date: Wed, 11 Jan 2023 13:38:09 +0900 Subject: [PATCH] drag-and-drop : Add leave event when dragging is cancelled Change-Id: If98ec6b0d766e3a898063456d05c6c82a6df0abc --- .../tizen-wayland/drag-and-drop-impl-ecore-wl2.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dali/internal/drag-and-drop/tizen-wayland/drag-and-drop-impl-ecore-wl2.cpp b/dali/internal/drag-and-drop/tizen-wayland/drag-and-drop-impl-ecore-wl2.cpp index b6654e6..ca895f1 100644 --- a/dali/internal/drag-and-drop/tizen-wayland/drag-and-drop-impl-ecore-wl2.cpp +++ b/dali/internal/drag-and-drop/tizen-wayland/drag-and-drop-impl-ecore-wl2.cpp @@ -34,6 +34,11 @@ namespace Internal { namespace Adaptor { +namespace +{ +static constexpr int32_t DEFAULT_POSITION = -1; +} + static bool IsIntersection(int px, int py, int tx, int ty, int tw, int th) { if(px > tx && py > ty && px < (tx + tw) && py < (ty + th)) @@ -260,6 +265,14 @@ void DragAndDropEcoreWl::ResetDropTargets() { for(std::size_t i = 0; i < mDropTargets.size(); i++) { + if(mDropTargets[i].inside) + { + Dali::DragAndDrop::DragEvent dragEvent; + dragEvent.SetAction(Dali::DragAndDrop::DragType::LEAVE); + Dali::Vector2 position(DEFAULT_POSITION, DEFAULT_POSITION); + dragEvent.SetPosition(position); + mDropTargets[i].callback(dragEvent); + } mDropTargets[i].inside = false; } } -- 2.7.4