forked from enlightenment/efl
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>
This commit is contained in:
parent
4b2188103d
commit
4d62761759
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue