DragAndDrop : make window's callback function called by window id 44/299544/3
authorTaehyub Kim <taehyub.kim@samsung.com>
Wed, 4 Oct 2023 11:23:10 +0000 (20:23 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Thu, 5 Oct 2023 01:51:30 +0000 (10:51 +0900)
Change-Id: Ie4256b16adeda3bfdf7db1d10d0241b4d2e237c5

dali/internal/drag-and-drop/tizen-wayland/drag-and-drop-impl-ecore-wl2.cpp

index 49c45ff..52f3bd0 100644 (file)
@@ -397,11 +397,6 @@ void DragAndDropEcoreWl::SendData(void* event)
 
   close(ev->fd);
 
-  if(mDragWindow)
-  {
-    mDragWindow.Hide();
-  }
-
   delete[] buffer;
 }
 
@@ -417,14 +412,29 @@ void DragAndDropEcoreWl::ReceiveData(void* event)
   }
   mTargetIndex = -1;
 
+  Ecore_Wl2_Display* display      = ecore_wl2_connected_display_get(NULL);
+  Ecore_Wl2_Input*   input        = ecore_wl2_input_default_input_get(display);
+
   if(mWindowTargetIndex != -1)
   {
     Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mWindowPosition, ev->mimetype, ev->data);
     mDropWindowTargets[mWindowTargetIndex].callback(dragEvent);
     mDropWindowTargets[mWindowTargetIndex].inside = false;
   }
-  mWindowTargetIndex = -1;
+  else if(ev->offer != ecore_wl2_dnd_selection_get(input))
+  {
+    for (std::size_t i = 0; i< mDropWindowTargets.size(); i++)
+    {
+      if (ev->win == mDropWindowTargets[i].windowId)
+      {
+        Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mWindowPosition, ev->mimetype, ev->data);
+        mDropWindowTargets[i].callback(dragEvent);
+        break;
+      }
+    }
+  }
 
+  mWindowTargetIndex = -1;
 }
 
 Vector2 DragAndDropEcoreWl::RecalculatePositionByOrientation(int x, int y, Dali::Window window)