Properly send kbd focus to xdg_shell popups

Oops, a client can have multiple top level windows.

ref f391a0fb67
This commit is contained in:
Derek Foreman 2016-07-08 16:12:43 -05:00
parent b80f0bfef7
commit 963afc8fea
1 changed files with 9 additions and 7 deletions

View File

@ -627,14 +627,16 @@ _e_comp_wl_evas_cb_focus_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
wc = wl_resource_get_client(ec->comp_data->surface); wc = wl_resource_get_client(ec->comp_data->surface);
if (ec->comp_data->is_xdg_surface) if (ec->comp_data->is_xdg_surface)
{ {
/* If an xdg shell popup's parent already has focus we don't /* We only send kbd focus to xdg top levels */
* need to do anything more. while (ec->parent)
*/ {
EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res) ec = ec->parent;
if (wl_resource_get_client(res) == wc) return;
/* We only kbd focus top level xdg */ /* If an xdg shell popup's parent already has focus we don't
while (ec->parent) ec = ec->parent; * need to do anything more.
*/
if (ec->focused) return;
}
} }
EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res) EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res)