Commit Graph

6 Commits

Author SHA1 Message Date
Jean Guyomarc'h d1e4c6bab8 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
2018-08-27 12:04:36 +09:00
Mike Blumenkrantz 6a500331bd ecore: fix event flushing to not erase+leak events
stealing the message data here prevents events which aren't being flushed from
ever being usable again and is unnecessary since the free callback will be
automatically called during the destructor

ref 5dd52fd09b
2018-02-07 12:12:22 -05:00
Mike Blumenkrantz da9eef6027 ecore: add function for prepending an event handler
@feature
2018-01-30 13:02:07 -05:00
Jean-Philippe Andre 06fea06c86 ecore: Simplify code 2017-12-18 19:54:31 +09:00
Jean-Philippe Andre 796b1dd566 ecore: Fix legacy message handlers destruction 2017-12-18 19:54:31 +09:00
Carsten Haitzler 5dd52fd09b ecore - begin moving data into the efl loop data in the object
we really should have data inside the loop object, so begin moving it
one small thing at a time. this is the basics that will allow multiple
efl loops. make an eo efl object and class for fd handlers that is efl loop
bound make fd handlers really bound to their parent loop and not global  as
well as have a nice class/obj. create an message queue per loop and
put legacy ecore events on top of it... and a lot more.

this is not 100% done, but it's a lot of the core and groundwork.
various ecore_timer_add(), ecore_diler_add() etc. need changes.

The following still need doing:

  ecore_timer (internal usage for sure)
  ecore_idler (internal usage for sure)
  ecore_idle_enterer
  ecore_idle_exiter
  ecore_pollers? (is the new efl loop stuff ok?)
  ecore_exe (fork/spawn from any thread and track exe from that thread?)
  ecore_signal code
  ecore_throttle (should we have a single global too? we have per loop)
  ecore_app ? (should every loop be given its own argv/argc?)

Lots of internal ecore code uses/calls these legacy calls and we
should have efl loop replacements and/or use the ones we have

The following will bedifferently designed for loop to loop
control/messaging/ipc:

  ecore_thread
  ecore_pipe
2017-12-15 14:16:53 +09:00