elm: _propagate_event should react only when the obj is focused obj
authorWooHyun Jung <wh0705.jung@samsung.com>
Fri, 23 Sep 2016 01:08:01 +0000 (10:08 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Fri, 23 Sep 2016 01:08:01 +0000 (10:08 +0900)
In efl_ui_win, _evas_event_key_cb gives efl_event_callback_call,
though the focused object is not the window itself.
Becuase of this, _propagate_event was called twice for event single
key down.
So, now, _propagate_event returns itself whenever focused object is
not the win but it's called from efl_ui_win's event call.
The problem can be checked with following stpes.

1. elementary_test -> focus
2. Input any directions (ex: Down)
3. Focus movement happens twice for every single input.

src/lib/elementary/elm_widget.c

index 1b7a94c..86514a3 100644 (file)
@@ -728,6 +728,10 @@ _propagate_event(void *data EINA_UNUSED, const Efl_Event *event)
    } event_info = {};
    Eina_Bool was_hold;
 
+   if ((evas_focus_get(evas_object_evas_get(obj)) != elm_widget_top_get(obj)) &&
+       efl_isa(obj, EFL_UI_WIN_CLASS))
+     return;
+
    /* FIXME: Avoid this translation to evas struct and use pointer/key events
     * in all of elementary widgets
     * See also: efl_input_key_legacy_info_fill().