add a client parameter to wl key down/up event processing functions

if passed, send the event to the specified client
This commit is contained in:
Mike Blumenkrantz 2017-09-21 13:31:04 -04:00
parent 92614d0c69
commit 5da5418873
3 changed files with 8 additions and 10 deletions

View File

@ -131,7 +131,7 @@ _key_down(int ctx, Ecore_Event_Key *ev)
(!e_comp->screen->key_down) || (!e_comp->screen->key_down(ev))) && (!e_comp->screen->key_down) || (!e_comp->screen->key_down(ev))) &&
!e_bindings_key_down_event_handle(ctx, E_OBJECT(e_comp), ev) !e_bindings_key_down_event_handle(ctx, E_OBJECT(e_comp), ev)
#ifdef HAVE_WAYLAND #ifdef HAVE_WAYLAND
&& !e_comp_wl_key_down(ev) && !e_comp_wl_key_down(ev, NULL)
#endif #endif
; ;
} }
@ -163,7 +163,7 @@ _key_up(int ctx, Ecore_Event_Key *ev)
(!e_comp->screen->key_up) || (!e_comp->screen->key_up(ev))) && (!e_comp->screen->key_up) || (!e_comp->screen->key_up(ev))) &&
!e_bindings_key_up_event_handle(ctx, E_OBJECT(e_comp), ev) !e_bindings_key_up_event_handle(ctx, E_OBJECT(e_comp), ev)
#ifdef HAVE_WAYLAND #ifdef HAVE_WAYLAND
&& !e_comp_wl_key_up(ev) && !e_comp_wl_key_up(ev, NULL)
#endif #endif
; ;
} }

View File

@ -3304,9 +3304,8 @@ e_comp_wl_output_remove(const char *id)
} }
EINTERN Eina_Bool EINTERN Eina_Bool
e_comp_wl_key_down(Ecore_Event_Key *ev) e_comp_wl_key_down(Ecore_Event_Key *ev, E_Client *ec)
{ {
E_Client *ec = NULL;
uint32_t serial, *end, *k, keycode; uint32_t serial, *end, *k, keycode;
if ((e_comp->comp_type != E_PIXMAP_TYPE_WL) || (ev->window != e_comp->ee_win)) return EINA_FALSE; if ((e_comp->comp_type != E_PIXMAP_TYPE_WL) || (ev->window != e_comp->ee_win)) return EINA_FALSE;
@ -3342,7 +3341,7 @@ e_comp_wl_key_down(Ecore_Event_Key *ev)
if ((!e_client_action_get()) && (!e_comp->input_key_grabs) && if ((!e_client_action_get()) && (!e_comp->input_key_grabs) &&
(!e_menu_is_active())) (!e_menu_is_active()))
{ {
ec = e_client_focused_get(); if (!ec) ec = e_client_focused_get();
if (ec && ec->comp_data->surface && e_comp_wl->kbd.focused) if (ec && ec->comp_data->surface && e_comp_wl->kbd.focused)
{ {
struct wl_resource *res; struct wl_resource *res;
@ -3361,9 +3360,8 @@ e_comp_wl_key_down(Ecore_Event_Key *ev)
} }
EINTERN Eina_Bool EINTERN Eina_Bool
e_comp_wl_key_up(Ecore_Event_Key *ev) e_comp_wl_key_up(Ecore_Event_Key *ev, E_Client *ec)
{ {
E_Client *ec = NULL;
uint32_t serial, *end, *k, keycode; uint32_t serial, *end, *k, keycode;
struct wl_resource *res; struct wl_resource *res;
Eina_List *l; Eina_List *l;
@ -3392,7 +3390,7 @@ e_comp_wl_key_up(Ecore_Event_Key *ev)
if ((!e_client_action_get()) && (!e_comp->input_key_grabs) && if ((!e_client_action_get()) && (!e_comp->input_key_grabs) &&
(!e_menu_is_active())) (!e_menu_is_active()))
{ {
ec = e_client_focused_get(); if (!ec) ec = e_client_focused_get();
if (e_comp_wl->kbd.focused) if (e_comp_wl->kbd.focused)
{ {

View File

@ -408,8 +408,8 @@ E_API double e_comp_wl_idle_time_get(void);
E_API Eina_Bool e_comp_wl_output_init(const char *id, const char *make, const char *model, int x, int y, int w, int h, int pw, int ph, unsigned int refresh, unsigned int subpixel, unsigned int transform, unsigned int num); E_API Eina_Bool e_comp_wl_output_init(const char *id, const char *make, const char *model, int x, int y, int w, int h, int pw, int ph, unsigned int refresh, unsigned int subpixel, unsigned int transform, unsigned int num);
E_API void e_comp_wl_output_remove(const char *id); E_API void e_comp_wl_output_remove(const char *id);
EINTERN Eina_Bool e_comp_wl_key_down(Ecore_Event_Key *ev); EINTERN Eina_Bool e_comp_wl_key_down(Ecore_Event_Key *ev, E_Client *ec);
EINTERN Eina_Bool e_comp_wl_key_up(Ecore_Event_Key *ev); EINTERN Eina_Bool e_comp_wl_key_up(Ecore_Event_Key *ev, E_Client *ec);
E_API Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state); E_API Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state);
E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD; E_API extern int E_EVENT_WAYLAND_GLOBAL_ADD;