static void _set_selection_list(Sel_Manager_Selection *sel_list, Sel_Manager_Seat_Selection *seat_sel);
#endif
+EAPI int ELM_CNP_EVENT_SELECTION_CHANGED = -1;
+
/* TIZEN_ONLY(20180430): fix duplicated string memory issue */
static Eina_Rw_Slice
_eina_slice_dup_safe(Eina_Slice slice)
{
Efl_Selection_Manager_Data *pd = data;
Efl_Selection_Changed e;
+ Elm_Cnp_Event_Selection_Changed *_e;
Ecore_X_Event_Fixes_Selection_Notify *ev = event;
Sel_Manager_Seat_Selection *seat_sel;
Efl_Selection_Type type;
e.type = type;
e.seat = 1; /* under x11 this is always the default seat */
e.exist = !!ev->owner;
+
+ _e = calloc(1, sizeof(Elm_Cnp_Event_Selection_Changed));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_e, ECORE_CALLBACK_RENEW);
+ _e->type = type;
+ _e->seat_id = 1;
+ _e->exists = e.exist;
+
+ ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, _e, NULL, NULL);
efl_event_callback_call(sel->owner, EFL_SELECTION_EVENT_SELECTION_CHANGED, &e);
- //ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, e, NULL, NULL);
return ECORE_CALLBACK_RENEW;
}
return _update_sel_lost_list(owner, type, seat_sel);
}
-/*static void
-_wl_selection_changed_free(void *data, void *ev EINA_UNUSED)
+static void
+_wl_selection_changed_free(void *data, void *ev)
{
ecore_wl2_display_disconnect(data);
-}*/
+
+ free(ev);
+}
static Eina_Bool
_wl_selection_changed(void *data, int type EINA_UNUSED, void *event)
{
Efl_Selection_Manager_Data *pd = data;
+ Elm_Cnp_Event_Selection_Changed *_e;
Sel_Manager_Seat_Selection *seat_sel;
Sel_Manager_Selection *sel;
Efl_Selection_Changed e;
/* connect again to add ref */
e.display = ecore_wl2_display_connect(ecore_wl2_display_name_get(ev->display));
e.exist = !!ecore_wl2_dnd_selection_get(seat);
- //ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, e, _wl_selection_changed_free, ev->display);
+
+ _e = calloc(1, sizeof(Elm_Cnp_Event_Selection_Changed));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(_e, ECORE_CALLBACK_RENEW);
+ _e->type = e.type;
+ _e->seat_id = e.seat;
+ _e->display = e.display;
+ _e->exists = e.exist;
+
+ ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, _e, _wl_selection_changed_free, ev->display);
efl_event_callback_call(sel->request_obj, EFL_SELECTION_EVENT_SELECTION_CHANGED, &e);
return ECORE_CALLBACK_RENEW;