explicitly manage client focus when setting/unsetting input grabs

clients cannot retain focus during a compositor grab, so ensure that
they do not think they have focus in such cases

fix T3338
This commit is contained in:
Mike Blumenkrantz 2016-03-31 11:11:02 -04:00
parent 7b201be6b3
commit 76b76af8ea
1 changed files with 13 additions and 1 deletions

View File

@ -1648,6 +1648,8 @@ e_comp_grab_input(Eina_Bool mouse, Eina_Bool kbd)
if ((e_comp->input_mouse_grabs && e_comp->input_key_grabs) ||
e_grabinput_get(mwin, 0, kwin))
{
if (e_client_focused_get())
evas_object_focus_set(e_client_focused_get()->frame, 0);
ret = EINA_TRUE;
e_comp->input_mouse_grabs += mouse;
e_comp->input_key_grabs += kbd;
@ -1675,7 +1677,17 @@ e_comp_ungrab_input(Eina_Bool mouse, Eina_Bool kbd)
e_grabinput_release(mwin, kwin);
evas_event_feed_mouse_out(e_comp->evas, 0, NULL);
evas_event_feed_mouse_in(e_comp->evas, 0, NULL);
if (e_client_focused_get()) return;
if (e_client_focused_get())
{
E_Client *ec = e_client_focused_get();
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
{
evas_object_focus_set(ec->frame, 0);
evas_object_focus_set(ec->frame, 1);
}
return;
}
if (e_config->focus_policy != E_FOCUS_MOUSE)
e_client_refocus();
}