forked from enlightenment/efl
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.
This commit is contained in:
parent
e5af7c914a
commit
0b1d67e793
|
@ -35,8 +35,15 @@ _unrealized_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||||
if (ev->info != data) return;
|
if (ev->info != data) return;
|
||||||
|
|
||||||
if (pd) /* if the obect is dead pd is NULL */
|
if (pd) /* if the obect is dead pd is NULL */
|
||||||
|
{
|
||||||
|
//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;
|
pd->realized = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_elm_widget_item_static_focus_efl_ui_focus_object_prepare_logical(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED)
|
_elm_widget_item_static_focus_efl_ui_focus_object_prepare_logical(Eo *obj, Elm_Widget_Item_Static_Focus_Data *pd EINA_UNUSED)
|
||||||
|
@ -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_REALIZED, _realized_cb, obj);
|
||||||
efl_event_callback_del(wpd->widget, ELM_GENGRID_EVENT_UNREALIZED, _unrealized_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));
|
return efl_destructor(efl_super(obj, MY_CLASS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue