genlist: Fixed focus object hidden bug on re-focus.
authorDaniel Juyung Seo <seojuyung2@gmail.com>
Sun, 23 Mar 2014 12:32:05 +0000 (21:32 +0900)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Sun, 23 Mar 2014 12:37:55 +0000 (21:37 +0900)
On smart_on_focus, genlist calls elm_object_item_focus_set. That API
internally calls _elm_widget_focus_highlight_start() but we need to call
this function once again because of the weird focus behavior.

Condition: enable focus highlight and focus highlight animation.
The first _elm_widget_focus_highlight_start() triggers
_elm_win_focus_highlight_simple_setup, and second call triggers
_elm_win_focus_highlight_anim_setup. But the first call does not show
the focus highlight object properly.

Reproduction scenario:
1. elementary_test -> genlist focus
2. click an item
3. scroll the genlist and move the focused item away from the viewport.
4. move the mouse pointer to another window
5. move the mouse pointer to the genlist window back again.
6. focus highlight object is now shown correctly.

By the way, this bug will be hidden when the focus highlight never
scrolls away. I will add this feature soon.

src/lib/elm_genlist.c

index 0490412..4158f59 100644 (file)
@@ -2897,6 +2897,7 @@ _elm_genlist_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
                     elm_genlist_item_selected_set(it, EINA_TRUE);
                   else
                     elm_object_item_focus_set(it, EINA_TRUE);
+                  _elm_widget_focus_highlight_start(obj);
                }
           }
      }