// Set default offer is reject
ecore_wl2_offer_accept(ev->offer, NULL);
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool EcoreEventDataLeave(void* data, int type, void* event)
+{
+ DragAndDropEcoreWl* dndImpl = reinterpret_cast<DragAndDropEcoreWl*>(data);
+ dndImpl->ResetDropTargets();
return ECORE_CALLBACK_PASS_ON;
}
mMotionHandler = ecore_event_handler_add(ECORE_WL2_EVENT_DND_MOTION, EcoreEventDataMotion, this);
mDropHandler = ecore_event_handler_add(ECORE_WL2_EVENT_DND_DROP, EcoreEventDataDrop, this);
mEnterHandler = ecore_event_handler_add(ECORE_WL2_EVENT_DND_ENTER, EcoreEventDataEnter, this);
+ mLeaveHandler = ecore_event_handler_add(ECORE_WL2_EVENT_DND_LEAVE, EcoreEventDataLeave, this);
}
DragAndDropEcoreWl::~DragAndDropEcoreWl()
}
}
+void DragAndDropEcoreWl::ResetDropTargets()
+{
+ for(std::size_t i = 0; i < mDropTargets.size(); i++)
+ {
+ mDropTargets[i].inside = false;
+ }
+}
+
+
void DragAndDropEcoreWl::SendData(void* event)
{
Ecore_Wl2_Event_Data_Source_Send* ev = reinterpret_cast<Ecore_Wl2_Event_Data_Source_Send*>(event);
*/
void CallSourceEvent(Dali::DragAndDrop::SourceEventType type);
+ /**
+ * @brief Reset drop targets.
+ */
+ void ResetDropTargets();
+
private:
DragAndDropEcoreWl(const DragAndDropEcoreWl&) = delete;
DragAndDropEcoreWl& operator=(DragAndDropEcoreWl&) = delete;
Ecore_Event_Handler* mMotionHandler{nullptr};
Ecore_Event_Handler* mDropHandler{nullptr};
Ecore_Event_Handler* mEnterHandler{nullptr};
+ Ecore_Event_Handler* mLeaveHandler{nullptr};
int mTargetIndex{0};
std::string mMimeType;
std::string mData;