From: Chris Michael Date: Wed, 8 Feb 2017 17:30:10 +0000 (-0500) Subject: ecore-wl2: Support sending focus for wl_shell X-Git-Tag: upstream/1.20.0~2107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d627617594e36178c4621c7f887ac9cfc4f9122;p=platform%2Fupstream%2Fefl.git ecore-wl2: Support sending focus for wl_shell wl_shell does not use a surface state for activation, so we still need to send the focus in/out for that based on keyboard enter/leave. @fix Signed-off-by: Chris Michael --- diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 636ddf9..4d810a6 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -854,12 +854,16 @@ _keyboard_cb_enter(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigne input->focus.keyboard = window; window->input = input; + + if (window->wl_shell_surface) + _ecore_wl2_input_focus_in_send(window); } static void -_keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface EINA_UNUSED) +_keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface) { Ecore_Wl2_Input *input; + Ecore_Wl2_Window *window; input = data; if (!input) return; @@ -872,6 +876,11 @@ _keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigne if (input->repeat.timer) ecore_timer_del(input->repeat.timer); input->repeat.timer = NULL; input->focus.keyboard = NULL; + + /* find the window which this surface belongs to */ + window = _ecore_wl2_display_window_surface_find(input->display, surface); + if ((window) && (window->wl_shell_surface)) + _ecore_wl2_input_focus_out_send(window); } static Eina_Bool