bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=620dd43db201cb5b24899c8f1e0bc3582f3e867e

commit 620dd43db201cb5b24899c8f1e0bc3582f3e867e
Author: Cedric BAIL <cedric.b...@free.fr>
Date:   Thu Nov 7 10:58:04 2019 -0800

    eo: make sure to return the right value for efl_event_callback_call.
    
    EINA_FALSE is to be returned only if one of the callback did call
    efl_event_callback_stop not if their was no callback called.
    
    Reviewed-by: Marcel Hollerbach <m...@marcel-hollerbach.de>
    Differential Revision: https://phab.enlightenment.org/D10620
---
 src/lib/eo/eo_base_class.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 43068c7f19..06cd48259f 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1978,7 +1978,7 @@ _cb_desc_match(const Efl_Event_Description *a, const 
Efl_Event_Description *b, E
 }
 
 #define EFL_OBJECT_EVENT_CALLBACK_BLOCK(Pd, Desc, Event)                \
-  if ((Desc == Event) && (!(Pd->event_cb_##Event))) return EINA_FALSE;
+  if ((Desc == Event) && (!(Pd->event_cb_##Event))) return EINA_TRUE;
 
 static inline Eina_Bool
 _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
@@ -1999,7 +1999,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
    };
    int event_hash;
 
-   if (pd->callbacks_count == 0) return EINA_FALSE;
+   if (pd->callbacks_count == 0) return EINA_TRUE;
    else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_ADD)
    else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_DEL)
    else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DEL)
@@ -2010,7 +2010,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
      {
         event_hash = _pointer_hash((uintptr_t) desc);
         if (!(pd->callbacks_mask & (1 << event_hash)))
-          return EINA_FALSE;
+          return EINA_TRUE;
      }
 
    if (pd->event_frame)
@@ -2060,6 +2060,7 @@ restart_back:
 
                        // Handle nested restart of walking list
                        if (lookup) lookup->current = idx - 1;
+
                        it->func((void *) (*cb)->func_data, &ev);
                        /* Abort callback calling if the func says so. */
                        if (pd->callback_stopped)
@@ -2083,6 +2084,7 @@ restart_back:
 
                   // Handle nested restart of walking list
                   if (lookup) lookup->current = idx - 1;
+
                   (*cb)->items.item.func((void *) (*cb)->func_data, &ev);
                   /* Abort callback calling if the func says so. */
                   if (pd->callback_stopped)
@@ -2176,7 +2178,6 @@ _efl_event_forwarder_callback(void *data, const Efl_Event 
*event)
    Eina_Bool ret = EINA_FALSE;
 
    ret = efl_event_callback_call(new_obj, event->desc, event->info);
-
    if (!ret)
      {
         efl_event_callback_stop(event->object);

-- 


Reply via email to