diff options
author | Daniel Juyung Seo <seojuyung2@gmail.com> | 2014-05-26 21:56:10 +0900 |
---|---|---|
committer | Daniel Juyung Seo <seojuyung2@gmail.com> | 2014-05-26 22:08:13 +0900 |
commit | ff32034da503d42d4ed45bfac327e20a7f9db28e (patch) | |
tree | 8fc80f042b3f6c0464e4c69b570f6d08cc625744 | |
parent | ae48eb827f68277c9b4ea4b59785d654b9786847 (diff) | |
download | elementary-ff32034da503d42d4ed45bfac327e20a7f9db28e.tar.gz |
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
-rw-r--r-- | src/lib/elm_gengrid.c | 1 | ||||
-rw-r--r-- | src/lib/elm_genlist.c | 1 | ||||
-rw-r--r-- | src/lib/elm_list.c | 1 | ||||
-rw-r--r-- | src/lib/elm_toolbar.c | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 87e5005f0..11b7254bf 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -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); diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 880b664d8..5f73def7e 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -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); diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c index e7a8462d1..4eaa8e16e 100644 --- a/src/lib/elm_list.c +++ b/src/lib/elm_list.c @@ -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) diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 7607cdd9c..b9d5a092c 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -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) |