discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=9006bb61e57bc31c9e1bc433609276cbf659b042
commit 9006bb61e57bc31c9e1bc433609276cbf659b042 Author: Mike Blumenkrantz <zm...@osg.samsung.com> Date: Wed Feb 11 11:50:06 2015 -0500 set wl client keyboard focus on evas focus and commit ensure that focus is applied even if there is no new frame --- src/bin/e_comp_wl.c | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 795991d..f5602fe 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -503,6 +503,31 @@ _e_comp_wl_client_idler_add(E_Client *ec) _idle_clients = eina_list_append(_idle_clients, ec); } +static void +_e_comp_wl_client_focus(E_Client *ec) +{ + struct wl_resource *res; + struct wl_client *wc; + uint32_t serial, *k; + Eina_List *l; + + /* update keyboard modifier state */ + wl_array_for_each(k, &e_comp->wl_comp_data->kbd.keys) + e_comp_wl_input_keyboard_state_update(e_comp->wl_comp_data, *k, EINA_TRUE); + + /* send keyboard_enter to all keyboard resources */ + wc = wl_resource_get_client(ec->comp_data->surface); + serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp); + ec->comp_data->focus_update = 1; + EINA_LIST_FOREACH(e_comp->wl_comp_data->kbd.resources, l, res) + { + if (wl_resource_get_client(res) != wc) continue; + wl_keyboard_send_enter(res, serial, ec->comp_data->surface, + &e_comp->wl_comp_data->kbd.keys); + ec->comp_data->focus_update = 0; + } +} + static void _e_comp_wl_evas_cb_focus_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { @@ -520,7 +545,8 @@ _e_comp_wl_evas_cb_focus_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj /* raise client priority */ _e_comp_wl_client_priority_raise(ec); - ec->comp_data->focus_update = 1; + + _e_comp_wl_client_focus(ec); } static void @@ -2526,27 +2552,7 @@ e_comp_wl_surface_commit(E_Client *ec) if (!(ep = ec->pixmap)) return EINA_FALSE; _e_comp_wl_client_evas_init(ec); if (ec->focused && ec->comp_data->focus_update) - { - struct wl_resource *res; - struct wl_client *wc; - uint32_t serial, *k; - Eina_List *l; - - /* update keyboard modifier state */ - wl_array_for_each(k, &e_comp->wl_comp_data->kbd.keys) - e_comp_wl_input_keyboard_state_update(e_comp->wl_comp_data, *k, EINA_TRUE); - - /* send keyboard_enter to all keyboard resources */ - wc = wl_resource_get_client(ec->comp_data->surface); - serial = wl_display_next_serial(e_comp->wl_comp_data->wl.disp); - EINA_LIST_FOREACH(e_comp->wl_comp_data->kbd.resources, l, res) - { - if (wl_resource_get_client(res) != wc) continue; - wl_keyboard_send_enter(res, serial, ec->comp_data->surface, - &e_comp->wl_comp_data->kbd.keys); - } - ec->comp_data->focus_update = 0; - } + _e_comp_wl_client_focus(ec); /* mark the pixmap as usable or not */ e_pixmap_usable_set(ep, (ec->comp_data->pending.buffer != NULL)); --