jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=54e5841b2f6386765dd5e2831aa3481b952e5fd4

commit 54e5841b2f6386765dd5e2831aa3481b952e5fd4
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Feb 16 19:34:08 2017 +0900

    evas: Re-fix post-event cb by supporting recursion
    
    The previous patch (b184874fa5a0c3177c) was preventing
    post-event callbacks from triggering any form of input event,
    including side-effects due to mouse,in. In fact by tracking
    which exact events we want to post-process we can support
    proper recursion. This fixes crashes in Bryce.
    
    I'm not changing the documentation as this is still a dubious
    code design.
    
    Fixes T3144
    Fixes T5157
---
 src/lib/evas/canvas/evas_callbacks.c     | 17 ++++++--
 src/lib/evas/canvas/evas_events.c        | 74 +++++++++++++++++---------------
 src/lib/evas/canvas/evas_focus.c         | 10 +++--
 src/lib/evas/canvas/evas_object_inform.c | 54 +++++++++++++++--------
 src/lib/evas/canvas/evas_object_main.c   | 17 +++++---
 src/lib/evas/include/evas_private.h      |  6 ++-
 6 files changed, 108 insertions(+), 70 deletions(-)

diff --git a/src/lib/evas/canvas/evas_callbacks.c 
b/src/lib/evas/canvas/evas_callbacks.c
index 42dd851..d4fd953 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -222,19 +222,20 @@ _eo_evas_cb(void *data, const Efl_Event *event)
 }
 
 void
-_evas_post_event_callback_call(Evas *eo_e, Evas_Public_Data *e)
+_evas_post_event_callback_call(Evas *eo_e, Evas_Public_Data *e, int 
min_event_id)
 {
    Evas_Post_Callback *pc;
    Eina_List *l, *l_next;
    int skip = 0;
 
-   if (e->delete_me || e->running_post_events) return;
+   if (e->delete_me) return;
    if (!e->post_events) return;
 
    _evas_walk(e);
-   e->running_post_events = EINA_TRUE;
+   e->running_post_events++;
    EINA_LIST_FOREACH_SAFE(e->post_events, l, l_next, pc)
      {
+        if ((unsigned int) pc->event_id < (unsigned int) min_event_id) break;
         e->post_events = eina_list_remove_list(e->post_events, l);
         if ((!skip) && (!e->delete_me) && (!pc->delete_me))
           {
@@ -242,8 +243,14 @@ _evas_post_event_callback_call(Evas *eo_e, 
Evas_Public_Data *e)
           }
         EVAS_MEMPOOL_FREE(_mp_pc, pc);
      }
-   e->running_post_events = EINA_FALSE;
+   e->running_post_events--;
    _evas_unwalk(e);
+
+   if (!e->running_post_events && e->post_events)
+     {
+        WRN("Not all post-event callbacks hve been processed!");
+        _evas_post_event_callback_call(eo_e, e, 0);
+     }
 }
 
 void
@@ -609,6 +616,8 @@ evas_post_event_callback_push(Evas *eo_e, 
Evas_Object_Event_Post_Cb func, const
 
    pc->func = func;
    pc->data = data;
+   pc->type = e->current_event;
+   pc->event_id = _evas_event_counter;
    e->post_events = eina_list_prepend(e->post_events, pc);
 }
 
diff --git a/src/lib/evas/canvas/evas_events.c 
b/src/lib/evas/canvas/evas_events.c
index 69a1586..aa0c9e7 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -30,16 +30,14 @@ static void
 _canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, 
int y,
                                      unsigned int timestamp, const void *data);
 
-static inline Eina_Bool
-_evas_event_feed_allow(Evas_Public_Data *e)
+static inline void
+_evas_event_feed_check(Evas_Public_Data *e)
 {
-   if (EINA_LIKELY(!e->running_post_events)) return EINA_TRUE;
-   ERR("Can not feed input events while running post-event callbacks!");
-   return EINA_FALSE;
+   if (EINA_LIKELY(!e->running_post_events)) return;
+   DBG("Feeding new input events from a post-event callback is risky!");
 }
 
-#define EVAS_EVENT_FEED_SAFETY_CHECK(evas, ...) do { \
-   if (!_evas_event_feed_allow(evas)) return __VA_ARGS__; } while (0)
+#define EVAS_EVENT_FEED_SAFETY_CHECK(evas) _evas_event_feed_check(evas)
 
 static void
 _evas_event_havemap_adjust_f(Evas_Object *eo_obj EINA_UNUSED, 
Evas_Object_Protected_Data *obj, Eina_Vector2 *point, Eina_Bool mouse_grabbed)
@@ -1500,7 +1498,7 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
      }
    if (copy) eina_list_free(copy);
    e->last_mouse_down_counter++;
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
    /* update touch point's state to EVAS_TOUCH_POINT_STILL */
    _evas_touch_point_update(eo_e, 0, pdata->x, pdata->y, 
EVAS_TOUCH_POINT_STILL);
    _evas_unwalk(e);
@@ -1508,7 +1506,7 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
    if (ev->device) efl_unref(ev->device);
 }
 
-static int
+static void
 _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer *parent_ev,
                 Evas_Pointer_Data *pdata)
 {
@@ -1517,14 +1515,13 @@ _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer 
*parent_ev,
    Efl_Input_Pointer *evt;
    Evas_Object *eo_obj;
    Evas *eo_e = e->evas;
-   int post_called = 0;
    Evas_Object_Pointer_Data *obj_pdata;
    int event_id;
 
    /* Duplicating UP event */
    evt = efl_input_dup(parent_ev);
    ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS);
-   if (!ev) return 0;
+   if (!ev) return;
 
    event_id = _evas_object_event_new();
 
@@ -1562,7 +1559,7 @@ _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer 
*parent_ev,
                }
           }
      }
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
 
    eina_list_free(copy);
 
@@ -1599,8 +1596,7 @@ _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer 
*parent_ev,
                   if (e->delete_me) break;
                }
           }
-        post_called = 1;
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
      }
    else
      {
@@ -1623,8 +1619,6 @@ _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer 
*parent_ev,
      _evas_canvas_event_pointer_move_event_dispatch(e, pdata, ev->data);
 
    efl_del(evt);
-
-   return post_called;
 }
 
 static void
@@ -1721,7 +1715,7 @@ _canvas_event_feed_mouse_up_internal(Evas_Public_Data *e, 
Efl_Input_Pointer_Data
      }
    eina_list_free(copy);
    e->last_mouse_up_counter++;
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
 
    if (pdata->mouse_grabbed == 0)
      _post_up_handle(e, evt, pdata);
@@ -1944,7 +1938,7 @@ _canvas_event_feed_mouse_wheel_internal(Eo *eo_e, 
Efl_Input_Pointer_Data *pe)
           }
      }
    eina_list_free(copy);
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
 
    efl_del(evt);
    _evas_unwalk(e);
@@ -2086,7 +2080,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
              if (e->delete_me) break;
           }
         eina_list_free(copy);
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
 
 
         /* Send mouse out events */
@@ -2118,7 +2112,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
                     _evas_event_source_mouse_out_events(eo_obj, eo_e, evt, 
event_id);
                }
           }
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
      }
    else
      {
@@ -2186,7 +2180,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
                }
           }
         eina_list_free(copy);
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
 
         /* new event id for mouse in */
         event_id = _evas_object_event_new();
@@ -2233,7 +2227,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
              /* free our cur ins */
              eina_list_free(ins);
           }
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
      }
 
 nogrep:
@@ -2330,7 +2324,7 @@ nogrep:
              if (e->delete_me) break;
           }
         eina_list_free(copy);
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
 
         event_id = _evas_object_event_new();
 
@@ -2366,7 +2360,7 @@ nogrep:
         /* and set up the new one */
         pdata->object.in = newin;
 
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
      }
 
    _evas_unwalk(e);
@@ -2485,7 +2479,7 @@ _canvas_event_feed_mouse_in_internal(Evas *eo_e, 
Efl_Input_Pointer_Data *ev)
    pdata->object.in = eina_list_free(pdata->object.in);
    /* and set up the new one */
    pdata->object.in = ins;
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
    _canvas_event_feed_mouse_move_internal(e, ev);
    _evas_unwalk(e);
 
@@ -2564,7 +2558,7 @@ _canvas_event_feed_mouse_out_internal(Evas *eo_e, 
Efl_Input_Pointer_Data *ev)
    /* free our old list of ins */
    pdata->object.in =  eina_list_free(pdata->object.in);
    pdata->mouse_grabbed = 0;
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
    _evas_unwalk(e);
 
    if (ev->device) efl_unref(ev->device);
@@ -2693,7 +2687,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
      }
    eina_list_free(copy);
 
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
    /* update touch point's state to EVAS_TOUCH_POINT_STILL */
    _evas_touch_point_update(eo_e, ev->tool, ev->cur.x, ev->cur.y, 
EVAS_TOUCH_POINT_STILL);
    _evas_unwalk(e);
@@ -2773,8 +2767,12 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Data
         if (e->delete_me || e->is_frozen) break;
      }
    eina_list_free(copy);
-   if ((pdata->mouse_grabbed == 0) && !_post_up_handle(e, evt, pdata))
-      _evas_post_event_callback_call(eo_e, e);
+   if (pdata->mouse_grabbed == 0)
+     {
+        _post_up_handle(e, evt, pdata);
+        _evas_post_event_callback_call(eo_e, e, event_id);
+     }
+
    /* remove released touch point from the touch point list */
    _evas_touch_point_remove(eo_e, ev->tool);
    _evas_unwalk(e);
@@ -2955,7 +2953,7 @@ _canvas_event_feed_multi_move_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
                }
           }
         eina_list_free(copy);
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
      }
    else
      {
@@ -3013,7 +3011,7 @@ _canvas_event_feed_multi_move_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
              /* free our cur ins */
              eina_list_free(ins);
           }
-        _evas_post_event_callback_call(eo_e, e);
+        _evas_post_event_callback_call(eo_e, e, event_id);
      }
    _evas_unwalk(e);
 
@@ -3089,10 +3087,13 @@ _canvas_event_feed_key_down_internal(Evas_Public_Data 
*e, Efl_Input_Key_Data *ev
    Eina_Bool exclusive = EINA_FALSE;
    Efl_Input_Pointer *evt;
    int event_id = 0;
+   Eo *eo_e;
 
    if (!e || !ev) return;
    if (e->is_frozen) return;
    EVAS_EVENT_FEED_SAFETY_CHECK(e);
+
+   eo_e = e->evas;
    e->last_timestamp = ev->timestamp;
    _evas_walk(e);
 
@@ -3164,7 +3165,7 @@ _canvas_event_feed_key_down_internal(Evas_Public_Data *e, 
Efl_Input_Key_Data *ev
    if (!exclusive)
      _key_event_dispatch(e, evt, ev->device, EFL_EVENT_KEY_DOWN,
                          EVAS_CALLBACK_KEY_DOWN, event_id);
-   _evas_post_event_callback_call(e->evas, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
    _evas_unwalk(e);
 
    if (ev->device) efl_unref(ev->device);
@@ -3176,10 +3177,13 @@ _canvas_event_feed_key_up_internal(Evas_Public_Data *e, 
Efl_Input_Key_Data *ev)
    Eina_Bool exclusive = EINA_FALSE;
    Efl_Input_Pointer *evt;
    int event_id = 0;
+   Eo *eo_e;
 
    if (!e || !ev) return;
    if (e->is_frozen) return;
    EVAS_EVENT_FEED_SAFETY_CHECK(e);
+
+   eo_e = e->evas;
    e->last_timestamp = ev->timestamp;
    _evas_walk(e);
 
@@ -3252,7 +3256,7 @@ _canvas_event_feed_key_up_internal(Evas_Public_Data *e, 
Efl_Input_Key_Data *ev)
    if (!exclusive)
      _key_event_dispatch(e, evt, ev->device, EFL_EVENT_KEY_UP,
                          EVAS_CALLBACK_KEY_UP, event_id);
-   _evas_post_event_callback_call(e->evas, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
    _evas_unwalk(e);
 
    if (ev->device) efl_unref(ev->device);
@@ -3372,7 +3376,7 @@ evas_event_feed_hold(Eo *eo_e, int hold, unsigned int 
timestamp, const void *dat
         if (e->delete_me || e->is_frozen) break;
      }
    eina_list_free(copy);
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
    _evas_unwalk(e);
    _evas_object_event_new();
 
@@ -3423,7 +3427,7 @@ _canvas_event_feed_axis_update_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_D
           }
      }
    eina_list_free(copy);
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
 
    _evas_unwalk(e);
    if (ev->device) efl_unref(ev->device);
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c
index 71351cc..cae966a 100644
--- a/src/lib/evas/canvas/evas_focus.c
+++ b/src/lib/evas/canvas/evas_focus.c
@@ -102,12 +102,12 @@ _evas_focus_dispatch_event(Evas_Object_Protected_Data 
*obj, Efl_Input_Device *se
 static void
 _evas_object_unfocus(Evas_Object_Protected_Data *obj, Efl_Input_Device *seat)
 {
+   int event_id = _evas_event_counter;
+
    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);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
@@ -156,11 +156,13 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
                                   Efl_Input_Device *seat)
 {
    Eo *current_focus;
+   int event_id;
 
    MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
    return EINA_FALSE;
    MAGIC_CHECK_END();
 
+   event_id = _evas_event_counter;
    if (!seat) seat = _default_seat_get(eo_obj);
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(seat, EINA_FALSE);
@@ -193,7 +195,7 @@ _efl_canvas_object_seat_focus_add(Eo *eo_obj,
 
    _evas_focus_dispatch_event(obj, seat, EINA_TRUE);
  end:
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
    return EINA_TRUE;
 }
 
diff --git a/src/lib/evas/canvas/evas_object_inform.c 
b/src/lib/evas/canvas/evas_object_inform.c
index 648688f..c0e8d30 100644
--- a/src/lib/evas/canvas/evas_object_inform.c
+++ b/src/lib/evas/canvas/evas_object_inform.c
@@ -8,78 +8,94 @@ void
 evas_object_inform_call_show(Evas_Object *eo_obj)
 {
    Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
+   int event_id = _evas_object_event_new();
 
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_SHOW, NULL, 
_evas_object_event_new(), EFL_GFX_EVENT_SHOW);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_SHOW, NULL, 
event_id, EFL_GFX_EVENT_SHOW);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
 evas_object_inform_call_hide(Evas_Object *eo_obj)
 {
    Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
+   int event_id = _evas_object_event_new();
 
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HIDE, NULL, 
_evas_object_event_new(), EFL_GFX_EVENT_HIDE);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HIDE, NULL, 
event_id, EFL_GFX_EVENT_HIDE);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
 evas_object_inform_call_move(Evas_Object *eo_obj, Evas_Object_Protected_Data 
*obj)
 {
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, NULL, 
_evas_object_event_new(), EFL_GFX_EVENT_MOVE);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   int event_id = _evas_object_event_new();
+
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, NULL, 
event_id, EFL_GFX_EVENT_MOVE);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
 evas_object_inform_call_resize(Evas_Object *eo_obj)
 {
    Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, NULL, 
_evas_object_event_new(), EFL_GFX_EVENT_RESIZE);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   int event_id = _evas_object_event_new();
+
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, NULL, 
event_id, EFL_GFX_EVENT_RESIZE);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
 evas_object_inform_call_restack(Evas_Object *eo_obj)
 {
    Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESTACK, NULL, 
_evas_object_event_new(), EFL_GFX_EVENT_RESTACK);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   int event_id = _evas_object_event_new();
+
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESTACK, NULL, 
event_id, EFL_GFX_EVENT_RESTACK);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
 evas_object_inform_call_changed_size_hints(Evas_Object *eo_obj)
 {
    Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
-   evas_object_event_callback_call(eo_obj, obj, 
EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL, _evas_object_event_new(), 
EFL_GFX_EVENT_CHANGE_SIZE_HINTS);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   int event_id = _evas_object_event_new();
+
+   evas_object_event_callback_call(eo_obj, obj, 
EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL, event_id, 
EFL_GFX_EVENT_CHANGE_SIZE_HINTS);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
 evas_object_inform_call_image_preloaded(Evas_Object *eo_obj)
 {
    Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
-   EINA_SAFETY_ON_NULL_RETURN(obj);
+   int event_id;
 
+   EINA_SAFETY_ON_NULL_RETURN(obj);
    if (!_evas_object_image_preloading_get(eo_obj)) return;
    _evas_image_load_post_update(eo_obj, obj);
    _evas_object_image_preloading_check(eo_obj);
    _evas_object_image_preloading_set(eo_obj, 0);
 
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_PRELOADED, 
NULL, _evas_object_event_new(), EFL_IMAGE_EVENT_PRELOAD);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   event_id = _evas_object_event_new();
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_PRELOADED, 
NULL, event_id, EFL_IMAGE_EVENT_PRELOAD);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
 evas_object_inform_call_image_unloaded(Evas_Object *eo_obj)
 {
    Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_UNLOADED, 
NULL, _evas_object_event_new(), EFL_IMAGE_EVENT_UNLOAD);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   int event_id = _evas_object_event_new();
+
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_UNLOADED, 
NULL, event_id, EFL_IMAGE_EVENT_UNLOAD);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
 
 void
 evas_object_inform_call_image_resize(Evas_Object *eo_obj)
 {
    Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_RESIZE, 
NULL, _evas_object_event_new(), EFL_IMAGE_EVENT_RESIZE);
-   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+   int event_id = _evas_object_event_new();
+
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_RESIZE, 
NULL, event_id, EFL_IMAGE_EVENT_RESIZE);
+   _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
 }
diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index 4ebb748..4f32c05 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -1027,23 +1027,26 @@ _efl_canvas_object_efl_object_destructor(Eo *eo_obj, 
Evas_Object_Protected_Data
    Efl_Input_Device *dev;
    Evas_Public_Data *edata;
    Evas_Object_Pointer_Data *pdata;
+   int event_id;
 
    edata = efl_data_scope_get(evas_object_evas_get(eo_obj), EVAS_CANVAS_CLASS);
    evas_object_hide(eo_obj);
    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);
+          _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);
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, 
_evas_object_event_new(), NULL);
+   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);
+     _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);
@@ -1095,9 +1098,10 @@ _efl_canvas_object_efl_object_destructor(Eo *eo_obj, 
Evas_Object_Protected_Data
 
    evas_object_map_set(eo_obj, NULL);
    if (obj->is_smart) evas_object_smart_del(eo_obj);
-   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FREE, NULL, 
_evas_object_event_new(), NULL);
+   event_id = _evas_object_event_new();
+   evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FREE, NULL, 
event_id, NULL);
    if ((obj->layer) && (obj->layer->evas))
-     _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
+     _evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, 
event_id);
    evas_object_smart_cleanup(eo_obj);
    obj->delete_me = 1;
    evas_object_change(eo_obj, obj);
@@ -1788,8 +1792,9 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data 
*obj)
                        ev.locks = &(obj->layer->evas->locks);
                        ev.timestamp = obj->layer->evas->last_timestamp;
                        ev.event_flags = EVAS_EVENT_FLAG_NONE;
+                       event_id = _evas_object_event_new();
                        evas_object_event_callback_call(eo_obj, obj, 
EVAS_CALLBACK_MOUSE_OUT, &ev);
-                       _evas_post_event_callback_call(obj->layer->evas, 
obj->layer->evas);
+                       _evas_post_event_callback_call(obj->layer->evas, 
obj->layer->evas, event_id);
                     }
  */
                }
diff --git a/src/lib/evas/include/evas_private.h 
b/src/lib/evas/include/evas_private.h
index 2495dca..7b237c2 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -787,6 +787,8 @@ struct _Evas_Post_Callback
 {
    Evas_Object_Event_Post_Cb  func;
    const void                *data;
+   int                        event_id;
+   Evas_Callback_Type         type;
    unsigned char              delete_me : 1;
 };
 
@@ -930,6 +932,7 @@ struct _Evas_Public_Data
    int            nochange;
    Evas_Font_Hinting_Flags hinting;
    Evas_Callback_Type current_event;
+   int            running_post_events;
 
    Eina_List     *touch_points;
    Eina_List     *devices;
@@ -949,7 +952,6 @@ struct _Evas_Public_Data
    Eina_Bool      rendering : 1;
    Eina_Bool      render2 : 1;
    Eina_Bool      common_init : 1;
-   Eina_Bool      running_post_events : 1;
 };
 
 struct _Evas_Layer
@@ -1684,7 +1686,7 @@ void 
evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, Evas_Smart_
 Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj);
 void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s);
 void *evas_mem_calloc(int size);
-void _evas_post_event_callback_call(Evas *e, Evas_Public_Data* e_pd);
+void _evas_post_event_callback_call(Evas *e, Evas_Public_Data* e_pd, int 
min_event_id);
 void _evas_post_event_callback_free(Evas *e);
 void evas_event_callback_list_post_free(Eina_Inlist **list);
 void evas_object_event_callback_all_del(Evas_Object *obj);

-- 


Reply via email to