unsigned int type_count = eina_array_count(available_types);
if (type_count == 0u)
{
- ERR("available_types is empty");
- return EINA_FALSE;
+ ERR("available_types is empty, selection clear");
+ _reeval_seat(&seat, ee);
+
+ for (int i = 0 ; i < ECORE_EVAS_SELECTION_CNP_TYPE_LAST; ++i)
+ {
+ Ecore_Evas_Wl_Selection_Data *data = &wdata->selection_datas[i];
+ Ecore_Evas_Selection_Callbacks *cbs = &data->callbacks;
+ if (cbs->cancel)
+ {
+ _clear_selection(ee, seat, selection, _cnp_type_to_mime_type((Ecore_Evas_Selection_Cnp_Type)i));
+ }
+
+ cbs->delivery = delivery;
+ cbs->cancel = cancel;
+ cbs->available_types = available_types;
+ }
+
+ char *tmp_array[type_count + 1];
+ tmp_array[type_count] = NULL;
+
+ ecore_wl2_dnd_selection_set(_fetch_input(ee, seat), (const char**)tmp_array);
+ return EINA_TRUE;
}
char *tmp_array[type_count + 1];