genlist: fixed wrong item focus set on item_focus_set API call.
Reset the last_focused_item on _item_focus_set_hook. This fixes the issue which sets the focus to the wrong item when the focus is set by an API. Reproduction step: elementary_test -> genlist focus -> click an item (not the 2nd item) -> click "Focus 2nd Item after 1.5 seconds" button. Focus is not moved to the 2nd item. @fix
This commit is contained in:
parent
d9f0509b5e
commit
7357290056
|
@ -2930,6 +2930,7 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
|
|||
|
||||
if (focused)
|
||||
{
|
||||
sd->last_focused_item = it;
|
||||
if (!elm_object_focus_get(obj))
|
||||
elm_object_focus_set(obj, EINA_TRUE);
|
||||
|
||||
|
|
|
@ -5670,6 +5670,7 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
|
|||
|
||||
if (focused)
|
||||
{
|
||||
sd->last_focused_item = it;
|
||||
if (!elm_object_focus_get(obj))
|
||||
elm_object_focus_set(obj, EINA_TRUE);
|
||||
|
||||
|
|
|
@ -1946,6 +1946,7 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
|
|||
|
||||
if (focused)
|
||||
{
|
||||
sd->last_focused_item = it;
|
||||
if (!elm_object_focus_get(obj))
|
||||
elm_object_focus_set(obj, EINA_TRUE);
|
||||
if (it != sd->focused_item)
|
||||
|
|
|
@ -806,6 +806,7 @@ _item_focus_set_hook(Elm_Object_Item *it, Eina_Bool focused)
|
|||
|
||||
if (focused)
|
||||
{
|
||||
sd->last_focused_item = it;
|
||||
if (!elm_object_focus_get(obj))
|
||||
elm_object_focus_set(obj, EINA_TRUE);
|
||||
if (it != (Elm_Object_Item *)sd->focused_item)
|
||||
|
|
Loading…
Reference in New Issue