edje: Edje_Edit - fix wrong behaviour on draggable.event processing while deleting...
authorVorobiov Vitalii <vi.vorobiov@samsung.com>
Wed, 21 May 2014 04:13:50 +0000 (06:13 +0200)
committerCedric Bail <cedric.bail@free.fr>
Wed, 21 May 2014 04:14:23 +0000 (06:14 +0200)
commitcf0ff2ba917cf5d8ec29755e88d8616c646ee733
tree5d8bf447e23eaedd05494adc4ff4277e88887c30
parent42e049fe865fce9a003f00ace172cdedb3f20bef
edje: Edje_Edit - fix wrong behaviour on draggable.event processing while deleting parts.

Summary:
the draggable.event field (in edje) is pointing on the id of the part it is assigned to.
The main problem is about deleting parts.
After part being deleted, all other parts (that are below the deleted part) have their id shifted,
but event doesnt shift.

For example,
1) draggable.event at some part pointing at part with id=7,
2) some other part is being deleted
3) part with id=7 have new id now (id=6)
4) draggable.event DOESN'T change it's pointer and still points at part with id=7 (which is now has id=6)
5) if there is no parts with id=7 anymore, then it could give you SEGFAULT someday (or not, depending on luck).

This commit contains next changes:
1) after deleting part, draggable.event also shifts (if required)
2) after deleting part that is being pointed with event by someone, it will remove all event points at it
@fix

Reviewers: cedric, raster, seoz

CC: reutskiy.v.v, cedric
Differential Revision: https://phab.enlightenment.org/D878

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
src/lib/edje/edje_edit.c