Ecore_Wl2_Event_Dnd_Motion* ev = reinterpret_cast<Ecore_Wl2_Event_Dnd_Motion*>(event);
Dali::DragAndDrop::DragEvent dragEvent;
- dragEvent.SetMimeType((const char*)eina_array_data_get(ecore_wl2_offer_mimes_get(ev->offer), 0));
+
+ Eina_Array *mimes = NULL;
+ mimes = ecore_wl2_offer_mimes_get(ev->offer);
+ if(mimes == NULL)
+ {
+ dragEvent.SetMimeType("");
+ }
+ else
+ {
+ dragEvent.SetMimeType((const char*)eina_array_data_get(mimes, 0));
+ }
Dali::Vector2 curPosition(ev->x, ev->y);
dragEvent.SetPosition(curPosition);
mDropTargets[i].callback(dragEvent);
// Accept Offer
- ecore_wl2_offer_mimes_set(ev->offer, ecore_wl2_offer_mimes_get(ev->offer));
+ ecore_wl2_offer_mimes_set(ev->offer, mimes);
}
else if(!currentInside && mDropTargets[i].inside)
{
dragEvent.SetPosition(curPosition);
mDropWindowTargets[i].callback(dragEvent);
// Accept Offer
- ecore_wl2_offer_mimes_set(ev->offer, ecore_wl2_offer_mimes_get(ev->offer));
+ ecore_wl2_offer_mimes_set(ev->offer, mimes);
}
else if(!currentInside && mDropWindowTargets[i].inside)
{
mTargetIndex = -1;
mWindowTargetIndex = -1;
+ Eina_Array *mimes = NULL;
+ mimes = ecore_wl2_offer_mimes_get(ev->offer);
+ if(mimes == NULL)
+ {
+ return false;
+ }
+
for(std::size_t i = 0; i < mDropTargets.size(); i++)
{
if(ev->win != static_cast<EcoreWl2EventDragAndDropWindowIdType>(mDropTargets[i].parentWindowId))
mPosition = position;
Dali::Window window = Dali::DevelWindow::Get(mDropTargets[i].target);
- char* mimetype = (char*)eina_array_data_get(ecore_wl2_offer_mimes_get(ev->offer), 0);
+ char* mimetype = (char*)eina_array_data_get(mimes, 0);
if(mimetype)
{
ecore_wl2_offer_receive(ev->offer, mimetype);
mWindowTargetIndex = i;
mWindowPosition = Dali::Vector2(position.GetX(), position.GetY());
- char* mimetype = (char*)eina_array_data_get(ecore_wl2_offer_mimes_get(ev->offer), 0);
+ char* mimetype = (char*)eina_array_data_get(mimes, 0);
if(mimetype)
{
ecore_wl2_offer_receive(ev->offer, mimetype);