summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-02-08 12:30:10 -0500
committerChris Michael <cp.michael@samsung.com>2017-02-08 12:30:10 -0500
commit4d627617594e36178c4621c7f887ac9cfc4f9122 (patch)
treeddf3f1c12944d09fc89e470e7212ea9cf0a8c5f6 /src/lib/ecore_wl2/ecore_wl2_input.c
parent4b2188103d22b591a062c25c5154636bac727616 (diff)
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 <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 636ddf93ba..4d810a65b8 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
854 854
855 input->focus.keyboard = window; 855 input->focus.keyboard = window;
856 window->input = input; 856 window->input = input;
857
858 if (window->wl_shell_surface)
859 _ecore_wl2_input_focus_in_send(window);
857} 860}
858 861
859static void 862static void
860_keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface EINA_UNUSED) 863_keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial, struct wl_surface *surface)
861{ 864{
862 Ecore_Wl2_Input *input; 865 Ecore_Wl2_Input *input;
866 Ecore_Wl2_Window *window;
863 867
864 input = data; 868 input = data;
865 if (!input) return; 869 if (!input) return;
@@ -872,6 +876,11 @@ _keyboard_cb_leave(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigne
872 if (input->repeat.timer) ecore_timer_del(input->repeat.timer); 876 if (input->repeat.timer) ecore_timer_del(input->repeat.timer);
873 input->repeat.timer = NULL; 877 input->repeat.timer = NULL;
874 input->focus.keyboard = NULL; 878 input->focus.keyboard = NULL;
879
880 /* find the window which this surface belongs to */
881 window = _ecore_wl2_display_window_surface_find(input->display, surface);
882 if ((window) && (window->wl_shell_surface))
883 _ecore_wl2_input_focus_out_send(window);
875} 884}
876 885
877static Eina_Bool 886static Eina_Bool