summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-12 12:49:37 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-17 09:12:22 +0100
commit5e0a602ee84957d0f39c3d9eadc1dceca1ed649c (patch)
tree2e6101169a0b4889517eeff13433ca4420c6975a
parente779492a1c029203d703ad31d4d647a45a5034dc (diff)
downloadefl-5e0a602ee84957d0f39c3d9eadc1dceca1ed649c.tar.gz
elm_widget_item_static_focus: fix ERR prints
There is the case that the deletion of the adapter can cause another registeration, which then calls another time prepare, which then deletes the adapter, before the actaul deletion of the first efl_del happened, which means it will throw an error. To avoid this we track if we are in process of a unrealization, and if so, do not delete the item there. Reviewed-by: YeongJong Lee <yj34.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D7453
-rw-r--r--src/lib/elementary/elm_widget_item_static_focus.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/elementary/elm_widget_item_static_focus.c b/src/lib/elementary/elm_widget_item_static_focus.c
index 168e982197..6a8a82aa6d 100644
--- a/src/lib/elementary/elm_widget_item_static_focus.c
+++ b/src/lib/elementary/elm_widget_item_static_focus.c
@@ -15,6 +15,7 @@
typedef struct {
Eo *adapter;
Eina_Bool realized;
+ Eina_Bool in_unrealize;
} Elm_Widget_Item_Static_Focus_Data;
static void
@@ -73,7 +74,9 @@ _unrealized_cb(void *data, const Efl_Event *ev EINA_UNUSED)
//only delete the adapter when not focused, this will lead to awfull artifacts
if (!efl_ui_focus_object_focus_get(pd->adapter))
{
+ pd->in_unrealize = EINA_TRUE;
efl_del(pd->adapter);
+ pd->in_unrealize = EINA_FALSE;
}
pd->realized = EINA_FALSE;
}
@@ -126,9 +129,12 @@ _elm_widget_item_static_focus_efl_ui_focus_object_prepare_logical_none_recursive
}
else if (logical_child && logical_child != pd->adapter)
{
- efl_ui_focus_manager_calc_unregister(wpd->widget, pd->adapter);
- efl_del(pd->adapter);
- pd->adapter = NULL;
+ if (!pd->in_unrealize)
+ {
+ efl_del(pd->adapter);
+ pd->adapter = NULL;
+ }
+
}
//genlist sometimes changes views when doing quick scrolls so reset the view in every possible call