elm_hoversel: make the keyevent handlers work again
authorMarcel Hollerbach <marcel@osg.samsung.com>
Sat, 7 Apr 2018 12:47:00 +0000 (14:47 +0200)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Apr 2018 13:26:07 +0000 (22:26 +0900)
i am not sure when this stopped working, elm hover sends focus to the
children it has, thus the propergation line for the key down events is
going from the hover up accross the over parent, however, the
hoverparent can be different to the hoversel, which would lead to
missing navigation in the hoversel.

this fixes T6802

src/lib/elementary/elc_hoversel.c

index 0322624..fee0768 100644 (file)
@@ -41,6 +41,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
 static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
 static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params);
 static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
+static Eina_Bool _hoversel_efl_ui_widget_widget_event(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED);
 
 static const Elm_Action key_actions[] = {
    {"move", _key_action_move},
@@ -469,6 +470,15 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object *obj)
    return NULL;
 }
 
+
+static void
+_hover_key_down(void *data, const Efl_Event *ev)
+{
+   ELM_HOVERSEL_DATA_GET(ev->object, sd);
+
+   _hoversel_efl_ui_widget_widget_event(data, sd, ev, ev->object);
+}
+
 static void
 _activate(Evas_Object *obj)
 {
@@ -490,6 +500,8 @@ _activate(Evas_Object *obj)
    sd->expanded = EINA_TRUE;
 
    sd->hover = elm_hover_add(sd->hover_parent);
+   efl_event_callback_add(sd->hover, EFL_EVENT_KEY_DOWN, _hover_key_down, obj);
+
    elm_widget_sub_object_add(obj, sd->hover);
    evas_object_layer_set(sd->hover, evas_object_layer_get(sd->hover_parent));