summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-05-26 21:56:10 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-05-26 22:08:13 +0900
commitff32034da503d42d4ed45bfac327e20a7f9db28e (patch)
tree8fc80f042b3f6c0464e4c69b570f6d08cc625744
parentae48eb827f68277c9b4ea4b59785d654b9786847 (diff)
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.c1
-rw-r--r--src/lib/elm_genlist.c1
-rw-r--r--src/lib/elm_list.c1
-rw-r--r--src/lib/elm_toolbar.c1
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)
2930 2930
2931 if (focused) 2931 if (focused)
2932 { 2932 {
2933 sd->last_focused_item = it;
2933 if (!elm_object_focus_get(obj)) 2934 if (!elm_object_focus_get(obj))
2934 elm_object_focus_set(obj, EINA_TRUE); 2935 elm_object_focus_set(obj, EINA_TRUE);
2935 2936
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)
5670 5670
5671 if (focused) 5671 if (focused)
5672 { 5672 {
5673 sd->last_focused_item = it;
5673 if (!elm_object_focus_get(obj)) 5674 if (!elm_object_focus_get(obj))
5674 elm_object_focus_set(obj, EINA_TRUE); 5675 elm_object_focus_set(obj, EINA_TRUE);
5675 5676
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)
1946 1946
1947 if (focused) 1947 if (focused)
1948 { 1948 {
1949 sd->last_focused_item = it;
1949 if (!elm_object_focus_get(obj)) 1950 if (!elm_object_focus_get(obj))
1950 elm_object_focus_set(obj, EINA_TRUE); 1951 elm_object_focus_set(obj, EINA_TRUE);
1951 if (it != sd->focused_item) 1952 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)
806 806
807 if (focused) 807 if (focused)
808 { 808 {
809 sd->last_focused_item = it;
809 if (!elm_object_focus_get(obj)) 810 if (!elm_object_focus_get(obj))
810 elm_object_focus_set(obj, EINA_TRUE); 811 elm_object_focus_set(obj, EINA_TRUE);
811 if (it != (Elm_Object_Item *)sd->focused_item) 812 if (it != (Elm_Object_Item *)sd->focused_item)