From: Chris Michael Date: Tue, 30 Jun 2015 19:58:10 +0000 (-0400) Subject: e-comp-wl: Release keys on key_up regardless if client has focus X-Git-Tag: upstream/0.20.0~678 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7cd07acad717f683e53c378809d73dea66880f03;p=platform%2Fupstream%2Fenlightenment.git e-comp-wl: Release keys on key_up regardless if client has focus Signed-off-by: Chris Michael --- diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index ef395c2..29eecdb 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -917,6 +917,9 @@ _e_comp_wl_cb_key_up(void *event) E_Comp_Wl_Data *cdata; Ecore_Event_Key *ev; uint32_t serial, *end, *k, keycode; + struct wl_client *wc = NULL; + struct wl_resource *res; + Eina_List *l; ev = event; keycode = (ev->keycode - 8); @@ -931,25 +934,24 @@ _e_comp_wl_cb_key_up(void *event) /* update modifier state */ e_comp_wl_input_keyboard_state_update(keycode, EINA_FALSE); - if ((ec = e_client_focused_get())) + ec = e_client_focused_get(); + if ((ec) && (ec->comp_data->surface)) { - if (ec->comp_data->surface) - { - struct wl_client *wc; - struct wl_resource *res; - Eina_List *l; + wc = wl_resource_get_client(ec->comp_data->surface); + } - if (eina_list_count(cdata->kbd.resources)) + if (eina_list_count(cdata->kbd.resources)) + { + serial = wl_display_next_serial(cdata->wl.disp); + EINA_LIST_FOREACH(cdata->kbd.resources, l, res) + { + if (wc) { - wc = wl_resource_get_client(ec->comp_data->surface); - serial = wl_display_next_serial(cdata->wl.disp); - EINA_LIST_FOREACH(cdata->kbd.resources, l, res) - { - if (wl_resource_get_client(res) != wc) continue; - wl_keyboard_send_key(res, serial, ev->timestamp, - keycode, WL_KEYBOARD_KEY_STATE_RELEASED); - } - } + if (wl_resource_get_client(res) != wc) continue; + } + + wl_keyboard_send_key(res, serial, ev->timestamp, + keycode, WL_KEYBOARD_KEY_STATE_RELEASED); } }