efl_ui_focus_manager_calc: invalidate obj on delete.

Summary:
In some situations focus is being set to a deleted object.
Use EFL_EVENT_INVALIDATE on object deletion not
EFL_EVENT_DEL. This prevents the object to be again selected for restoring focus when a redirect is deleted.

This fixes SEGV with some widgets including popup tests.

Test Plan:
* elementary_test -to popup
* popup-center-text + 3 button (check add, remove buttons).
* Close popup, enter text (reopen popup and repeat).
* Crash should be avoided.

Reviewers: bu5hm4n, zmike

Reviewed By: bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7026
This commit is contained in:
Alastair Poole 2018-09-12 20:01:57 +01:00
parent 4aa480f6d3
commit 111f2fe89c
1 changed files with 2 additions and 2 deletions

View File

@ -470,11 +470,11 @@ _object_del_cb(void *data, const Efl_Event *event)
EFL_CALLBACKS_ARRAY_DEFINE(regular_node,
{EFL_GFX_ENTITY_EVENT_RESIZE, _node_new_geometry_cb},
{EFL_GFX_ENTITY_EVENT_MOVE, _node_new_geometry_cb},
{EFL_EVENT_DEL, _object_del_cb},
{EFL_EVENT_INVALIDATE, _object_del_cb},
);
EFL_CALLBACKS_ARRAY_DEFINE(logical_node,
{EFL_EVENT_DEL, _object_del_cb},
{EFL_EVENT_INVALIDATE, _object_del_cb},
);