if (source->input->display->wl.data_device_manager_version >=
WL_DATA_OFFER_FINISH_SINCE_VERSION)
wl_data_offer_finish(source->offer);
+ wl_data_offer_destroy(source->offer);
}
fd = ecore_main_fd_handler_fd_get(source->fdh);
{
int p[2];
+ source->active_read = EINA_TRUE;
+
if (pipe2(p, O_CLOEXEC) == -1)
return;
ecore_event_add(ECORE_WL2_EVENT_DND_ENTER, ev, NULL, NULL);
}
+static void
+_delay_offer_destroy(void *user_data, void *event)
+{
+ Ecore_Wl2_Dnd_Source *source;
+
+ source = user_data;
+
+ if (source && source->offer
+ && !source->active_read)
+ {
+ wl_data_offer_destroy(source->offer);
+ source->offer = NULL;
+ }
+
+ free(event);
+}
+
void
_ecore_wl2_dnd_leave(Ecore_Wl2_Input *input)
{
if (!ev->win) ev->win = ev->source;
- ecore_event_add(ECORE_WL2_EVENT_DND_LEAVE, ev, NULL, NULL);
+ ecore_event_add(ECORE_WL2_EVENT_DND_LEAVE, ev, _delay_offer_destroy, input->drag.source);
}
void
ev->x = input->pointer.sx;
ev->y = input->pointer.sy;
- ecore_event_add(ECORE_WL2_EVENT_DND_DROP, ev, NULL, NULL);
+ ecore_event_add(ECORE_WL2_EVENT_DND_DROP, ev, _delay_offer_destroy, input->drag.source);
}
void