static Eina_Bool _wl_dnd_receive(void *data, int type EINA_UNUSED, void *event);
static Eina_Bool _wl_dnd_end(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED);
+//TIZEN_ONLY(20170523): add dnd cancel event for releasing drag source
+static Eina_Bool _wl_dnd_cancel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED);
+//
static void _wl_dropable_data_handle(Wl_Cnp_Selection *sel, Ecore_Wl_Event_Selection_Data_Ready *ev);
static Dropable *_wl_dropable_find(unsigned int win);
//_wl_dnd_end, &wl_cnp_selection);// TIZEN ONLY(20160627)
_wl_dnd_end, &wl_cnp_selections);// TIZEN ONLY(20160627)
+ //TIZEN_ONLY(20170523): add dnd cancel event for releasing drag source
+ ecore_event_handler_add(ECORE_WL_EVENT_DATA_SOURCE_CANCELLED,
+ _wl_dnd_cancel, &wl_cnp_selections);
+ //
+
return EINA_TRUE;
}
return ECORE_CALLBACK_PASS_ON;
}
+//TIZEN_ONLY(20170523): add dnd cancel event for releasing drag source
+static Eina_Bool
+_wl_dnd_cancel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
+{
+ cnp_debug("In\n");
+ if (dragdonecb) dragdonecb(dragdonedata, dragwidget);
+
+ // Remove drag win when drop on non-dropable app
+ evas_object_event_callback_del_full(dragwidget, EVAS_CALLBACK_HIDE,
+ _wl_drag_parent_hide_cb, dragwin);
+ if (dragwin)
+ {
+ if (!doaccept)
+ {
+ /* Commit animation when drag cancelled */
+ /* Record final position of dragwin, then do animation */
+ ecore_animator_timeline_add(0.3, _drag_cancel_animate, dragwin);
+ }
+ else
+ {
+ /* No animation drop was committed */
+ evas_object_del(dragwin);
+ }
+
+ dragwin = NULL; /* if not freed here, free in end of anim */
+ }
+
+ dragdonecb = NULL;
+ dragacceptcb = NULL;
+ dragposcb = NULL;
+ dragwidget = NULL;
+ doaccept = EINA_FALSE;
+
+ ecore_wl_input_ungrab(ecore_wl_input_get());
+
+ // support multiple selection types' buffer
+ Wl_Cnp_Selection *sels = data;
+ Wl_Cnp_Selection *sel = NULL;
+ if (sels) sel = sels + ELM_SEL_TYPE_XDND;
+ if (sel)
+ {
+ sel->active = EINA_FALSE;
+ evas_object_event_callback_del_full(sel->requestwidget,
+ EVAS_CALLBACK_DEL,
+ _wl_sel_obj_del2, sel);
+ sel->requestwidget = NULL;
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+//
+
static void
_wl_dropable_data_handle(Wl_Cnp_Selection *sel, Ecore_Wl_Event_Selection_Data_Ready *ev)
{