bu5hm4n pushed a commit to branch master.

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

commit 0b1d67e7938a9f94d9b834d683c12071149b022b
Author: Marcel Hollerbach <[email protected]>
Date:   Thu Mar 1 08:37:06 2018 +0100

    elm_widget_item_static_focus: delete adapter when deleted or unrealized
    
    somehow genlist leaks the view sometimes, thus the adapter is not
    deleted when the item is deleted. This resulted in strange ghost focus
    objects in the window.
---
 src/lib/elementary/elm_widget_item_static_focus.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/elm_widget_item_static_focus.c 
b/src/lib/elementary/elm_widget_item_static_focus.c
index 2826c9af1b..a5219e311b 100644
--- a/src/lib/elementary/elm_widget_item_static_focus.c
+++ b/src/lib/elementary/elm_widget_item_static_focus.c
@@ -35,7 +35,14 @@ _unrealized_cb(void *data, const Efl_Event *ev EINA_UNUSED)
    if (ev->info != data) return;
 
    if (pd) /* if the obect is dead pd is NULL */
-     pd->realized = EINA_FALSE;
+     {
+        //only delete the adapter when not focused, this will lead to awfull 
artifacts
+        if (!efl_ui_focus_object_focus_get(pd->adapter))
+          {
+             efl_del(pd->adapter);
+          }
+        pd->realized = EINA_FALSE;
+     }
 }
 
 EOLIAN static void
@@ -105,6 +112,10 @@ _elm_widget_item_static_focus_efl_object_destructor(Eo 
*obj, Elm_Widget_Item_Sta
         efl_event_callback_del(wpd->widget, ELM_GENGRID_EVENT_REALIZED, 
_realized_cb, obj);
         efl_event_callback_del(wpd->widget, ELM_GENGRID_EVENT_UNREALIZED, 
_unrealized_cb, obj);
      }
+
+   if (pd->adapter)
+     efl_del(pd->adapter);
+
    return efl_destructor(efl_super(obj, MY_CLASS));
 }
 

-- 


Reply via email to