discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d3f8ca29025af91655d61302eaa589ba6563a315

commit d3f8ca29025af91655d61302eaa589ba6563a315
Author: Marcel Hollerbach <[email protected]>
Date:   Wed Aug 8 09:39:22 2018 -0400

    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
---
 src/lib/elementary/efl_ui_focus_composition.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_focus_composition.c 
b/src/lib/elementary/efl_ui_focus_composition.c
index a35e71f99a..57c45ad35b 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 {
    Eina_List *order, *targets_ordered;
    Eina_List *register_target, *registered_targets;
    Eina_List *adapters;
-   Efl_Ui_Focus_Manager *registered, *custom_manager;
+   Efl_Ui_Focus_Manager *registered, *custom_manager, *old_manager;
    Eina_Bool dirty;
    Eina_Bool logical;
 } Efl_Ui_Focus_Composition_Data;
@@ -39,6 +39,7 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd)
         Eina_List *safed = NULL;
         Efl_Ui_Focus_Object *o;
 
+        pd->old_manager = manager;
         //remove all of them
         EINA_LIST_FREE(pd->registered_targets, o)
           {
@@ -75,6 +76,21 @@ _state_apply(Eo *obj, Efl_Ui_Focus_Composition_Data *pd)
 
         efl_ui_focus_manager_calc_update_order(manager, obj, 
eina_list_clone(pd->targets_ordered));
      }
+   else
+     {
+        Efl_Ui_Focus_Object *o;
+
+        EINA_LIST_FREE(pd->registered_targets, o)
+          {
+             efl_ui_focus_manager_calc_unregister(pd->old_manager, o);
+
+             if (efl_isa(o, EFL_UI_FOCUS_COMPOSITION_ADAPTER_CLASS))
+               {
+                  efl_ui_focus_composition_adapter_focus_manager_parent_set(o, 
NULL);
+                  efl_ui_focus_composition_adapter_focus_manager_object_set(o, 
NULL);
+               }
+          }
+     }
 }
 static void
 _del(void *data, const Efl_Event *ev)

-- 


Reply via email to