aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-03-01 08:37:06 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-03-15 15:39:12 +0100
commit0b1d67e7938a9f94d9b834d683c12071149b022b (patch)
tree70af4bd7cdadcbcb6a461d208c207fb5f3d3f947
parentelm_genlist: set focus to the item when a user calls the function (diff)
downloadefl-0b1d67e7938a9f94d9b834d683c12071149b022b.tar.gz
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.
-rw-r--r--src/lib/elementary/elm_widget_item_static_focus.c13
1 files changed, 12 insertions, 1 deletions
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));
}