summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-11-07 10:58:04 -0800
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-07 22:24:07 +0100
commit620dd43db201cb5b24899c8f1e0bc3582f3e867e (patch)
tree8e42b4b3b378e3110ced803ca7b406d02d7efe70
parent65955b7a9f84275c9ff799ef84cda6500c225bb1 (diff)
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 <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D10620
-rw-r--r--src/lib/eo/eo_base_class.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 43068c7..06cd482 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
1978} 1978}
1979 1979
1980#define EFL_OBJECT_EVENT_CALLBACK_BLOCK(Pd, Desc, Event) \ 1980#define EFL_OBJECT_EVENT_CALLBACK_BLOCK(Pd, Desc, Event) \
1981 if ((Desc == Event) && (!(Pd->event_cb_##Event))) return EINA_FALSE; 1981 if ((Desc == Event) && (!(Pd->event_cb_##Event))) return EINA_TRUE;
1982 1982
1983static inline Eina_Bool 1983static inline Eina_Bool
1984_event_callback_call(Eo *obj_id, Efl_Object_Data *pd, 1984_event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
@@ -1999,7 +1999,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
1999 }; 1999 };
2000 int event_hash; 2000 int event_hash;
2001 2001
2002 if (pd->callbacks_count == 0) return EINA_FALSE; 2002 if (pd->callbacks_count == 0) return EINA_TRUE;
2003 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_ADD) 2003 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_ADD)
2004 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_DEL) 2004 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_DEL)
2005 else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DEL) 2005 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,
2010 { 2010 {
2011 event_hash = _pointer_hash((uintptr_t) desc); 2011 event_hash = _pointer_hash((uintptr_t) desc);
2012 if (!(pd->callbacks_mask & (1 << event_hash))) 2012 if (!(pd->callbacks_mask & (1 << event_hash)))
2013 return EINA_FALSE; 2013 return EINA_TRUE;
2014 } 2014 }
2015 2015
2016 if (pd->event_frame) 2016 if (pd->event_frame)
@@ -2060,6 +2060,7 @@ restart_back:
2060 2060
2061 // Handle nested restart of walking list 2061 // Handle nested restart of walking list
2062 if (lookup) lookup->current = idx - 1; 2062 if (lookup) lookup->current = idx - 1;
2063
2063 it->func((void *) (*cb)->func_data, &ev); 2064 it->func((void *) (*cb)->func_data, &ev);
2064 /* Abort callback calling if the func says so. */ 2065 /* Abort callback calling if the func says so. */
2065 if (pd->callback_stopped) 2066 if (pd->callback_stopped)
@@ -2083,6 +2084,7 @@ restart_back:
2083 2084
2084 // Handle nested restart of walking list 2085 // Handle nested restart of walking list
2085 if (lookup) lookup->current = idx - 1; 2086 if (lookup) lookup->current = idx - 1;
2087
2086 (*cb)->items.item.func((void *) (*cb)->func_data, &ev); 2088 (*cb)->items.item.func((void *) (*cb)->func_data, &ev);
2087 /* Abort callback calling if the func says so. */ 2089 /* Abort callback calling if the func says so. */
2088 if (pd->callback_stopped) 2090 if (pd->callback_stopped)
@@ -2176,7 +2178,6 @@ _efl_event_forwarder_callback(void *data, const Efl_Event *event)
2176 Eina_Bool ret = EINA_FALSE; 2178 Eina_Bool ret = EINA_FALSE;
2177 2179
2178 ret = efl_event_callback_call(new_obj, event->desc, event->info); 2180 ret = efl_event_callback_call(new_obj, event->desc, event->info);
2179
2180 if (!ret) 2181 if (!ret)
2181 { 2182 {
2182 efl_event_callback_stop(event->object); 2183 efl_event_callback_stop(event->object);