summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-08 09:39:22 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-08 09:39:22 -0400
commitd3f8ca29025af91655d61302eaa589ba6563a315 (patch)
treef69b48d449ab6cf01e572c684b5a5f027a8fedec /src
parent08b9eeef281b0a42de83d1467d83e37b68a9567b (diff)
efl_ui_composition: remove all registered children on unregister
Summary: ensure that all the children are gone once we unregister the widget itself. This helps widgets that are not cleaning up theire children / items on invalidation. ref T7213. Reviewers: CHAN, YOhoho, zmike Reviewed By: zmike Subscribers: cedric, #committers, zmike Tags: #efl Maniphest Tasks: T7213 Differential Revision: https://phab.enlightenment.org/D6754
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_focus_composition.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_focus_composition.c b/src/lib/elementary/efl_ui_focus_composition.c
index a35e71f..57c45ad 100644
--- a/src/lib/elementary/efl_ui_focus_composition.c
+++ b/src/lib/elementary/efl_ui_focus_composition.c
@@ -15,7 +15,7 @@ typedef struct {
15 Eina_List *order, *targets_ordered; 15 Eina_List *order, *targets_ordered;
16 Eina_List *register_target, *registered_targets; 16 Eina_List *register_target, *registered_targets;
17 Eina_List *adapters; 17 Eina_List *adapters;
18 Efl_Ui_Focus_Manager *registered, *custom_manager; 18 Efl_Ui_Focus_Manager *registered, *custom_manager, *old_manager;
19 Eina_Bool dirty; 19 Eina_Bool dirty;
20 Eina_Bool logical; 20 Eina_Bool logical;
21} Efl_Ui_Focus_Composition_Data; 21} Efl_Ui_Focus_Composition_Data;
@@ -39,6 +39,7 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd)
39 Eina_List *safed = NULL; 39 Eina_List *safed = NULL;
40 Efl_Ui_Focus_Object *o; 40 Efl_Ui_Focus_Object *o;
41 41
42 pd->old_manager = manager;
42 //remove all of them 43 //remove all of them
43 EINA_LIST_FREE(pd->registered_targets, o) 44 EINA_LIST_FREE(pd->registered_targets, o)
44 { 45 {
@@ -75,6 +76,21 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd)
75 76
76 efl_ui_focus_manager_calc_update_order(manager, obj, eina_list_clone(pd->targets_ordered)); 77 efl_ui_focus_manager_calc_update_order(manager, obj, eina_list_clone(pd->targets_ordered));
77 } 78 }
79 else
80 {
81 Efl_Ui_Focus_Object *o;
82
83 EINA_LIST_FREE(pd->registered_targets, o)
84 {
85 efl_ui_focus_manager_calc_unregister(pd->old_manager, o);
86
87 if (efl_isa(o, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
88 {
89 efl_ui_focus_composition_adapter_focus_manager_parent_set(o, NULL);
90 efl_ui_focus_composition_adapter_focus_manager_object_set(o, NULL);
91 }
92 }
93 }
78} 94}
79static void 95static void
80_del(void *data, const Efl_Event *ev) 96_del(void *data, const Efl_Event *ev)