forked from enlightenment/enlightenment
only send key events to focused clients
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
7f2b83c8d9
commit
931409c687
|
@ -719,11 +719,9 @@ static void
|
|||
_e_comp_wl_cb_key_down(void *event)
|
||||
{
|
||||
E_Comp_Data *cdata;
|
||||
E_Client *ec;
|
||||
Ecore_Event_Key *ev;
|
||||
uint32_t serial, *end, *k, keycode;
|
||||
struct wl_resource *res;
|
||||
struct wl_client *wc;
|
||||
Eina_List *l;
|
||||
|
||||
ev = event;
|
||||
keycode = (ev->keycode - 8);
|
||||
|
@ -744,12 +742,24 @@ _e_comp_wl_cb_key_down(void *event)
|
|||
/* update modifier state */
|
||||
e_comp_wl_input_keyboard_state_update(cdata, keycode, EINA_TRUE);
|
||||
|
||||
if ((ec = e_client_focused_get()))
|
||||
{
|
||||
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);
|
||||
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_PRESSED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cdata->kbd.mod_changed)
|
||||
{
|
||||
|
@ -765,9 +775,6 @@ _e_comp_wl_cb_key_up(void *event)
|
|||
E_Comp_Data *cdata;
|
||||
Ecore_Event_Key *ev;
|
||||
uint32_t serial, *end, *k, keycode;
|
||||
struct wl_resource *res;
|
||||
struct wl_client *wc;
|
||||
Eina_List *l;
|
||||
|
||||
ev = event;
|
||||
keycode = (ev->keycode - 8);
|
||||
|
@ -782,12 +789,24 @@ _e_comp_wl_cb_key_up(void *event)
|
|||
/* update modifier state */
|
||||
e_comp_wl_input_keyboard_state_update(cdata, keycode, EINA_FALSE);
|
||||
|
||||
if ((ec = e_client_focused_get()))
|
||||
{
|
||||
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);
|
||||
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 (cdata->kbd.mod_changed)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue