From f9d3219c1739d7abea16fecd92fcc0981ddf801c Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 13 Jun 2017 11:08:55 +0900 Subject: [PATCH] Revert "evas: put events related pointer into a cow to reduce evas_object fat." This reverts commit f69686ba4023c7ddd83ea38000e8fa0c61818365. this causes major crashes in e every time you move and resize a window. i cant even debug it properly because i cant move or resize windows to get terminals up to debug it... this is bad... so until a fix is found better to go back to working... --- .../evas/canvas/efl_canvas_object_event_grabber.c | 85 ++++++++-------------- src/lib/evas/canvas/evas_callbacks.c | 4 +- src/lib/evas/canvas/evas_events.c | 4 +- src/lib/evas/canvas/evas_focus.c | 18 ++--- src/lib/evas/canvas/evas_object_main.c | 84 +++++++-------------- src/lib/evas/include/evas_private.h | 32 +++----- 6 files changed, 80 insertions(+), 147 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_object_event_grabber.c b/src/lib/evas/canvas/efl_canvas_object_event_grabber.c index 30d3f88..12d882d 100644 --- a/src/lib/evas/canvas/efl_canvas_object_event_grabber.c +++ b/src/lib/evas/canvas/efl_canvas_object_event_grabber.c @@ -31,7 +31,7 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_iterator_next(Efl_Object if (!eina_clist_next(it->head, it->current)) return EINA_FALSE; - obj = EINA_CLIST_ENTRY(eina_clist_head(it->current), Evas_Object_Protected_Data, events->event.member); + obj = EINA_CLIST_ENTRY(eina_clist_head(it->current), Evas_Object_Protected_Data, event.member); if (data) *data = obj->object; it->current = eina_clist_next(it->head, it->current); @@ -100,14 +100,6 @@ _stacking_verify(Efl_Object_Event_Grabber_Data *pd, Evas_Object_Protected_Data * } static void -_child_add_after(Evas_Object_Protected_Data *a, Evas_Object_Events_Data *events) -{ - EINA_COW_WRITE_BEGIN(evas_object_events_cow, a->events, Evas_Object_Events_Data, evs) - eina_clist_add_after(&evs->event.member, &events->event.member); - EINA_COW_WRITE_END(evas_object_events_cow, a->events, evs); -} - -static void _child_insert(Efl_Object_Event_Grabber_Data *pd, Evas_Object_Protected_Data *obj) { Evas_Object_Protected_Data *a, *i; @@ -115,44 +107,38 @@ _child_insert(Efl_Object_Event_Grabber_Data *pd, Evas_Object_Protected_Data *obj if (eina_clist_empty(&pd->contained)) { /* pd->rect case */ - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - eina_clist_add_head(&pd->contained, &events->event.member); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); + eina_clist_add_head(&pd->contained, &obj->event.member); return; } if (pd->vis) _stacking_verify(pd, obj); - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) + EINA_CLIST_FOR_EACH_ENTRY_REV(a, &pd->contained, Evas_Object_Protected_Data, event.member) { - EINA_CLIST_FOR_EACH_ENTRY_REV(a, &pd->contained, Evas_Object_Protected_Data, events->event.member) + if (a->object == pd->rect) + { + eina_clist_add_after(&a->event.member, &obj->event.member); + return; + } + if (a->layer->layer > obj->layer->layer) continue; + if (a->layer->layer < obj->layer->layer) + { + eina_clist_add_after(&a->event.member, &obj->event.member); + return; + } + EINA_INLIST_FOREACH(EINA_INLIST_GET(a->layer->objects), i) { - if (a->object == pd->rect) + if (a == i) { - _child_add_after(a, events); + eina_clist_add_after(&a->event.member, &obj->event.member); return; } - if (a->layer->layer > obj->layer->layer) continue; - if (a->layer->layer < obj->layer->layer) + if (obj == i) { - _child_add_after(a, events); + eina_clist_add_before(&a->event.member, &obj->event.member); return; } - EINA_INLIST_FOREACH(EINA_INLIST_GET(a->layer->objects), i) - { - if (a == i) - { - _child_add_after(a, events); - return; - } - if (obj == i) - { - _child_add_after(a, events); - return; - } - } } } - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); } static void @@ -161,10 +147,7 @@ _efl_canvas_object_event_grabber_child_restack(void *data, const Efl_Event *even Efl_Object_Event_Grabber_Data *pd = data; Evas_Object_Protected_Data *obj = efl_data_scope_get(event->object, EFL_CANVAS_OBJECT_CLASS); - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - eina_clist_remove(&events->event.member); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); - + eina_clist_remove(&obj->event.member); _child_insert(pd, obj); } @@ -214,12 +197,10 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_member_add(Eo *eo_obj, E return; } } - if (obj->events->event.parent == eo_obj) return; + if (obj->event.parent == eo_obj) return; - if (obj->smart.parent || obj->events->event.parent) evas_object_smart_member_del(member); - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - events->event.parent = eo_obj; - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); + if (obj->smart.parent || obj->event.parent) evas_object_smart_member_del(member); + obj->event.parent = eo_obj; _child_insert(pd, obj); efl_event_callback_add(member, EFL_EVENT_DEL, _efl_canvas_object_event_grabber_child_del, pd); if (member != pd->rect) @@ -233,12 +214,8 @@ _efl_canvas_object_event_grabber_efl_canvas_group_group_member_del(Eo *eo_obj EI efl_event_callback_del(member, EFL_EVENT_DEL, _efl_canvas_object_event_grabber_child_del, pd); efl_event_callback_del(member, EFL_GFX_EVENT_RESTACK, _efl_canvas_object_event_grabber_child_restack, pd); - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - { - eina_clist_remove(&events->event.member); - events->event.parent = NULL; - } - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); + eina_clist_remove(&obj->event.member); + obj->event.parent = NULL; } EOLIAN static void @@ -286,7 +263,7 @@ _efl_canvas_object_event_grabber_efl_gfx_visible_set(Eo *eo_obj EINA_UNUSED, Efl { Evas_Object_Protected_Data *obj; - EINA_CLIST_FOR_EACH_ENTRY(obj, &pd->contained, Evas_Object_Protected_Data, events->event.member) + EINA_CLIST_FOR_EACH_ENTRY(obj, &pd->contained, Evas_Object_Protected_Data, event.member) if (obj->object != pd->rect) _stacking_verify(pd, obj); } pd->vis = !!set; @@ -310,13 +287,11 @@ _efl_canvas_object_event_grabber_restack(void *data, const Efl_Event *event) evas_object_layer_set(pd->rect, evas_object_layer_get(event->object)); evas_object_stack_below(pd->rect, event->object); - EINA_CLIST_FOR_EACH_ENTRY_SAFE(obj, nobj, &pd->contained, Evas_Object_Protected_Data, events->event.member) + EINA_CLIST_FOR_EACH_ENTRY_SAFE(obj, nobj, &pd->contained, Evas_Object_Protected_Data, event.member) { if (obj->object == pd->rect) continue; list = eina_list_append(list, obj); - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - eina_clist_remove(&events->event.member); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); + eina_clist_remove(&obj->event.member); } EINA_LIST_FREE(list, obj) _child_insert(pd, obj); @@ -326,7 +301,7 @@ EOLIAN static Eo * _efl_canvas_object_event_grabber_efl_object_constructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd) { Evas_Object_Protected_Data *obj; - + eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); efl_canvas_object_type_set(eo_obj, MY_CLASS_NAME_LEGACY); obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); @@ -346,7 +321,7 @@ EOLIAN static void _efl_canvas_object_event_grabber_efl_object_destructor(Eo *eo_obj, Efl_Object_Event_Grabber_Data *pd) { Evas_Object_Protected_Data *obj, *nobj; - EINA_CLIST_FOR_EACH_ENTRY_SAFE(obj, nobj, &pd->contained, Evas_Object_Protected_Data, events->event.member) + EINA_CLIST_FOR_EACH_ENTRY_SAFE(obj, nobj, &pd->contained, Evas_Object_Protected_Data, event.member) efl_canvas_group_member_del(eo_obj, obj->object); efl_canvas_group_del(eo_obj); efl_destructor(efl_super(eo_obj, MY_CLASS)); diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c index 35cc834..822baa2 100644 --- a/src/lib/evas/canvas/evas_callbacks.c +++ b/src/lib/evas/canvas/evas_callbacks.c @@ -436,13 +436,13 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data nothing_here: if (!obj->no_propagate) { - if ((obj->smart.parent || obj->events->event.parent) && (type != EVAS_CALLBACK_FREE) && + if ((obj->smart.parent || obj->event.parent) && (type != EVAS_CALLBACK_FREE) && (type <= EVAS_CALLBACK_KEY_UP)) { Evas_Object_Protected_Data *parent_obj; Eo *parent; - parent = obj->events->event.parent ?: obj->smart.parent; + parent = obj->event.parent ?: obj->smart.parent; parent_obj = efl_data_scope_get(parent, EFL_CANVAS_OBJECT_CLASS); evas_object_event_callback_call(parent, parent_obj, type, event_info, event_id, efl_event_desc); } diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 222169b..a97129d 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -387,7 +387,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, obj; obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev)) { - if (obj->events->event.parent) continue; + if (obj->event.parent) continue; in = _evas_event_object_list_raw_in_get_single(eo_e, obj, in, stop, x, y, no_rep, source #ifdef DDD_DO ,&spaces @@ -398,7 +398,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, } else { - EINA_CLIST_FOR_EACH_ENTRY_SAFE_REV(obj, nobj, clist, Evas_Object_Protected_Data, events->event.member) + EINA_CLIST_FOR_EACH_ENTRY_SAFE_REV(obj, nobj, clist, Evas_Object_Protected_Data, event.member) { in = _evas_event_object_list_raw_in_get_single(eo_e, obj, in, stop, x, y, no_rep, source #ifdef DDD_DO diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c index 6ea934a..0b79bf9 100644 --- a/src/lib/evas/canvas/evas_focus.c +++ b/src/lib/evas/canvas/evas_focus.c @@ -106,10 +106,7 @@ _evas_object_unfocus(Evas_Object_Protected_Data *obj, Efl_Input_Device *seat) { int event_id = _evas_event_counter; - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - events->focused_by_seats = eina_list_remove(events->focused_by_seats, seat); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); - + obj->focused_by_seats = eina_list_remove(obj->focused_by_seats, seat); _evas_focus_set(obj->object, seat, EINA_FALSE); _evas_focus_dispatch_event(obj, seat, EINA_FALSE); _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); @@ -141,7 +138,7 @@ _efl_canvas_object_seat_focus_del(Eo *eo_obj, obj->layer->evas->pending_default_focus_obj = NULL; } - EINA_LIST_FOREACH(obj->events->focused_by_seats, l, dev) + EINA_LIST_FOREACH(obj->focused_by_seats, l, dev) { if (dev != seat) continue; @@ -187,7 +184,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj, if (!efl_input_seat_event_filter_get(eo_obj, seat)) return EINA_FALSE; - if (_already_focused(obj->events->focused_by_seats, seat)) + if (_already_focused(obj->focused_by_seats, seat)) goto end; if (_evas_object_intercept_call_evas(obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET, @@ -205,10 +202,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj, efl_event_callback_add(seat, EFL_EVENT_DEL, _evas_focus_device_del_cb, obj); - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - events->focused_by_seats = eina_list_append(events->focused_by_seats, seat); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); - + obj->focused_by_seats = eina_list_append(obj->focused_by_seats, seat); _evas_focus_set(eo_obj, seat, EINA_TRUE); _evas_focus_dispatch_event(obj, seat, EINA_TRUE); @@ -231,7 +225,7 @@ _efl_canvas_object_seat_focus_check(Eo *eo_obj, if (!seat) seat = _default_seat_get(eo_obj); - EINA_LIST_FOREACH(obj->events->focused_by_seats, l, s) + EINA_LIST_FOREACH(obj->focused_by_seats, l, s) { if (s == seat) return EINA_TRUE; @@ -259,7 +253,7 @@ _efl_canvas_object_seat_focus_get(Eo *eo_obj, Evas_Object_Protected_Data *obj) return EINA_FALSE; MAGIC_CHECK_END(); - return eina_list_count(obj->events->focused_by_seats) ? EINA_TRUE : EINA_FALSE; + return eina_list_count(obj->focused_by_seats) ? EINA_TRUE : EINA_FALSE; } EOLIAN Eina_Bool diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index b1547b6..9a5ccdd 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -35,16 +35,12 @@ static const Evas_Object_Protected_State default_state = { static const Evas_Object_Mask_Data default_mask = { NULL, 0, 0, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE }; -static const Evas_Object_Events_Data default_events = { - NULL, NULL, NULL, { NULL, { 0 } } -}; Eina_Cow *evas_object_proxy_cow = NULL; Eina_Cow *evas_object_map_cow = NULL; Eina_Cow *evas_object_state_cow = NULL; Eina_Cow *evas_object_3d_cow = NULL; Eina_Cow *evas_object_mask_cow = NULL; -Eina_Cow *evas_object_events_cow = NULL; static Eina_Bool _init_cow(void) @@ -56,24 +52,21 @@ _init_cow(void) evas_object_state_cow = eina_cow_add("Evas Object State", sizeof (Evas_Object_Protected_State), 64, &default_state, EINA_FALSE); evas_object_3d_cow = eina_cow_add("Evas Object 3D", sizeof (Evas_Object_3D_Data), 8, &default_proxy, EINA_TRUE); evas_object_mask_cow = eina_cow_add("Evas Mask Data", sizeof (Evas_Object_Mask_Data), 8, &default_mask, EINA_TRUE); - evas_object_events_cow = eina_cow_add("Evas Events Data", sizeof (Evas_Object_Events_Data), 8, &default_events, EINA_TRUE); if (!(evas_object_map_cow && evas_object_proxy_cow && evas_object_state_cow && - evas_object_3d_cow && evas_object_mask_cow && evas_object_events_cow)) + evas_object_3d_cow && evas_object_mask_cow)) { eina_cow_del(evas_object_proxy_cow); eina_cow_del(evas_object_map_cow); eina_cow_del(evas_object_state_cow); eina_cow_del(evas_object_3d_cow); eina_cow_del(evas_object_mask_cow); - eina_cow_del(evas_object_events_cow); evas_object_proxy_cow = NULL; evas_object_map_cow = NULL; evas_object_state_cow = NULL; evas_object_3d_cow = NULL; evas_object_mask_cow = NULL; - evas_object_events_cow = NULL; return EINA_FALSE; } @@ -87,7 +80,7 @@ _evas_object_pointer_data_find(Evas_Object_Protected_Data *obj, { Evas_Object_Pointer_Data *pdata; - EINA_INLIST_FOREACH(obj->events->pointer_grabs, pdata) + EINA_INLIST_FOREACH(obj->pointer_grabs, pdata) { if (pdata->evas_pdata->pointer == pointer) return pdata; @@ -120,10 +113,8 @@ _evas_object_pointer_grab_del(Evas_Object_Protected_Data *obj, pdata->evas_pdata->seat->object.in = eina_list_remove(pdata->evas_pdata->seat->object.in, obj->object); efl_event_callback_del(pdata->evas_pdata->pointer, EFL_EVENT_DEL, _evas_device_del_cb, obj); - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - events->pointer_grabs = eina_inlist_remove(events->pointer_grabs, EINA_INLIST_GET(pdata)); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); - + obj->pointer_grabs = eina_inlist_remove(obj->pointer_grabs, + EINA_INLIST_GET(pdata)); free(pdata); } @@ -137,11 +128,8 @@ _evas_object_pointer_data_add(Evas_Pointer_Data *evas_pdata, EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL); pdata->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB; pdata->evas_pdata = evas_pdata; - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - events->pointer_grabs = eina_inlist_append(events->pointer_grabs, - EINA_INLIST_GET(pdata)); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); - + obj->pointer_grabs = eina_inlist_append(obj->pointer_grabs, + EINA_INLIST_GET(pdata)); efl_event_callback_priority_add(evas_pdata->pointer, EFL_EVENT_DEL, EFL_CALLBACK_PRIORITY_BEFORE, _evas_device_del_cb, obj); @@ -189,7 +177,6 @@ _efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data obj->prev = eina_cow_alloc(evas_object_state_cow); obj->data_3d = eina_cow_alloc(evas_object_3d_cow); obj->mask = eina_cow_alloc(evas_object_mask_cow); - obj->events = eina_cow_alloc(evas_object_events_cow); evas_object_inject(eo_obj, obj, evas); evas_object_callback_init(eo_obj, obj); @@ -904,7 +891,7 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_get(Eo *eo_obj EINA_UNU //It means this object accept events from any seat. if (!obj->events_filter_enabled) return EINA_TRUE; - return eina_list_data_find(obj->events->events_whitelist, seat) ? + return eina_list_data_find(obj->events_whitelist, seat) ? EINA_TRUE : EINA_FALSE; } @@ -912,11 +899,8 @@ static void _whitelist_events_device_remove_cb(void *data, const Efl_Event *event) { Evas_Object_Protected_Data *obj = data; - - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - events->events_whitelist = eina_list_remove(events->events_whitelist, - event->object); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); + obj->events_whitelist = eina_list_remove(obj->events_whitelist, + event->object); } EOLIAN static void @@ -932,10 +916,10 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj, obj->events_filter_enabled = EINA_TRUE; if (add) { - if (eina_list_data_find(obj->events->events_whitelist, seat)) return; + if (eina_list_data_find(obj->events_whitelist, seat)) return; /* remove all previously focused seats, if any - it may happen since there wasn't a whitelist in place (no restrictions) */ - if ((!obj->events->events_whitelist) && (obj->layer) && (obj->layer->evas)) + if ((!obj->events_whitelist) && (obj->layer) && (obj->layer->evas)) { const Eina_List *devices, *l; Efl_Input_Device *dev; @@ -948,20 +932,14 @@ _efl_canvas_object_efl_input_interface_seat_event_filter_set(Eo *eo_obj, efl_canvas_object_seat_focus_del(eo_obj, dev); } } - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - events->events_whitelist = eina_list_append(events->events_whitelist, seat); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); - + obj->events_whitelist = eina_list_append(obj->events_whitelist, seat); efl_event_callback_add(seat, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj); } else { efl_canvas_object_seat_focus_del(eo_obj, seat); - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - events->events_whitelist = eina_list_remove(events->events_whitelist, seat); - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); - + obj->events_whitelist = eina_list_remove(obj->events_whitelist, seat); efl_event_callback_del(seat, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj); } @@ -1032,30 +1010,24 @@ _efl_canvas_object_efl_object_destructor(Eo *eo_obj, Evas_Object_Protected_Data edata = efl_data_scope_get(evas_object_evas_get(eo_obj), EVAS_CANVAS_CLASS); evas_object_hide(eo_obj); - - EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events) - { - EINA_LIST_FREE (events->focused_by_seats, dev) - { - event_id = _evas_event_counter; - efl_event_callback_del(dev, EFL_EVENT_DEL, - _evas_focus_device_del_cb, obj); - eina_hash_del_by_key(edata->focused_objects, &dev); - _evas_focus_dispatch_event(obj, dev, EINA_FALSE); - if ((obj->layer) && (obj->layer->evas)) - _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); - } - EINA_INLIST_FREE(events->pointer_grabs, pdata) - _evas_object_pointer_grab_del(obj, pdata); - EINA_LIST_FREE(events->events_whitelist, dev) - efl_event_callback_del(dev, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj); - } - EINA_COW_WRITE_END(evas_object_events_cow, obj->events, events); - + EINA_LIST_FREE (obj->focused_by_seats, dev) + { + event_id = _evas_event_counter; + efl_event_callback_del(dev, EFL_EVENT_DEL, + _evas_focus_device_del_cb, obj); + eina_hash_del_by_key(edata->focused_objects, &dev); + _evas_focus_dispatch_event(obj, dev, EINA_FALSE); + if ((obj->layer) && (obj->layer->evas)) + _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); + } + EINA_INLIST_FREE(obj->pointer_grabs, pdata) + _evas_object_pointer_grab_del(obj, pdata); event_id = _evas_object_event_new(); evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, event_id, NULL); if ((obj->layer) && (obj->layer->evas)) _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id); + EINA_LIST_FREE(obj->events_whitelist, dev) + efl_event_callback_del(dev, EFL_EVENT_DEL, _whitelist_events_device_remove_cb, obj); if (obj->name) evas_object_name_set(eo_obj, NULL); if (obj->layer) { @@ -1765,7 +1737,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { Evas_Object_Pointer_Data *obj_pdata; - EINA_INLIST_FOREACH(obj->events->pointer_grabs, obj_pdata) + EINA_INLIST_FOREACH(obj->pointer_grabs, obj_pdata) { if (!obj_pdata->mouse_grabbed && evas_object_is_in_output_rect(eo_obj, obj, obj_pdata->evas_pdata->seat->x, diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 50333f0..fea6c3a 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -86,7 +86,6 @@ typedef struct _Evas_Post_Callback Evas_Post_Callback; typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point; typedef struct _Evas_Object_Proxy_Data Evas_Object_Proxy_Data; typedef struct _Evas_Object_Map_Data Evas_Object_Map_Data; -typedef struct _Evas_Object_Events_Data Evas_Object_Events_Data; typedef struct _Evas_Proxy_Render_Data Evas_Proxy_Render_Data; typedef struct _Evas_Object_3D_Data Evas_Object_3D_Data; typedef struct _Evas_Object_Mask_Data Evas_Object_Mask_Data; @@ -1094,23 +1093,6 @@ struct _Evas_Object_Mask_Data Eina_Bool is_scaled : 1; }; -struct _Evas_Object_Events_Data -{ - /* - The list below contain the seats (Efl.Input.Devices) which this - object allows events to be reported (Mouse, Keybord and focus events). - */ - Eina_List *events_whitelist; - - Eina_List *focused_by_seats; - Eina_Inlist *pointer_grabs; - - struct { - Evas_Object *parent; - Eina_Clist member; - } event; -}; - struct _Evas_Object_Protected_State { Evas_Object_Protected_Data *clipper; @@ -1166,6 +1148,11 @@ struct _Evas_Object_Protected_Data Eina_List *grabs; Eina_Inlist *callbacks; + /* + The list below contain the seats (Efl.Input.Devices) which this + object allows events to be reported (Mouse, Keybord and focus events). + */ + Eina_List *events_whitelist; struct { Eina_List *clipees; @@ -1184,12 +1171,18 @@ struct _Evas_Object_Protected_Data Evas_Object_Protected_Data *parent_object_data; } smart; + struct { + Evas_Object *parent; + Eina_Clist member; + } event; + // Eina_Cow pointer be careful when writing to it const Evas_Object_Proxy_Data *proxy; const Evas_Object_Map_Data *map; const Evas_Object_3D_Data *data_3d; const Evas_Object_Mask_Data *mask; - const Evas_Object_Events_Data *events; + Eina_List *focused_by_seats; + Eina_Inlist *pointer_grabs; // Pointer to the Evas_Object itself Evas_Object *object; @@ -2085,7 +2078,6 @@ extern Eina_Cow *evas_object_image_pixels_cow; extern Eina_Cow *evas_object_image_load_opts_cow; extern Eina_Cow *evas_object_image_state_cow; extern Eina_Cow *evas_object_mask_cow; -extern Eina_Cow *evas_object_events_cow; # define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \ EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \ -- 2.7.4