summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2018-08-27 12:04:35 +0900
committerHermet Park <hermetpark@gmail.com>2018-08-27 12:04:36 +0900
commitd1e4c6bab84e55837a70b8883a28e7eb6d49db09 (patch)
tree96ed5a0e02152433ad6a8113dad2bab5aa38609f /src/lib/ecore
parentdb15b0347290c59a2e335d5afcffea6c7ae5a607 (diff)
ecore: fix built-in event types generation
Summary: Ecore internally uses 10 events, from ECORE_EVENT_SIGNAL_USER=1 to ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED=10. The Ecore.Event.Message_Handler singleton that holds the counter of events is initialized with -1. This is followed in _ecore_event_init() by ten calls to ecore_event_message_handler_type_new(), which increase the counter of event by one each. This results in an event counter to be 9 (-1 + 10) at the end of the initialization of ecore_events. This means that the next event to be created will have a value of 10, which will overlap with ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED. As such, these two distinct events will be aliased and their associated handlers will be called at unexpected times, with unexpected data. By changing the constructor value from -1 to 0, we prevent this event aliasing. Fixes T6605 Reviewers: zmike, Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers, zmike Tags: #efl Maniphest Tasks: T6605 Differential Revision: https://phab.enlightenment.org/D6894
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_event_message_handler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ecore/ecore_event_message_handler.c b/src/lib/ecore/ecore_event_message_handler.c
index 1b593d0771..f5498832f9 100644
--- a/src/lib/ecore/ecore_event_message_handler.c
+++ b/src/lib/ecore/ecore_event_message_handler.c
@@ -290,7 +290,7 @@ EOLIAN static Efl_Object *
290_ecore_event_message_handler_efl_object_constructor(Eo *obj, Ecore_Event_Message_Handler_Data *pd) 290_ecore_event_message_handler_efl_object_constructor(Eo *obj, Ecore_Event_Message_Handler_Data *pd)
291{ 291{
292 obj = efl_constructor(efl_super(obj, MY_CLASS)); 292 obj = efl_constructor(efl_super(obj, MY_CLASS));
293 pd->event_type_count = -1; 293 pd->event_type_count = 0;
294 pd->current_event_type = -1; 294 pd->current_event_type = -1;
295 return obj; 295 return obj;
296} 296}