handle input detection for wl surface grabs more accurately using stacking

this should more accurately handle cases where mouse movements over grabbed
surfaces are intercepted by overlapping windows
This commit is contained in:
Mike Blumenkrantz 2016-11-30 12:46:54 -05:00
parent f83045dc62
commit ca5176e6fa
1 changed files with 12 additions and 4 deletions

View File

@ -3434,11 +3434,19 @@ e_comp_wl_client_is_grabbed(const E_Client *ec)
static Eina_Bool
_check_grab_coords(E_Client *ec, int x, int y)
{
if (e_comp_object_coords_inside_input_area(ec->frame, x, y)) return EINA_TRUE;
while (ec->parent)
E_Client *tec, *pec;
E_CLIENT_REVERSE_FOREACH(tec)
{
ec = ec->parent;
if (e_comp_object_coords_inside_input_area(ec->frame, x, y)) return EINA_TRUE;
if (!e_comp_object_coords_inside_input_area(tec->frame, x, y)) continue;
if (tec == ec) return EINA_TRUE;
pec = ec->parent;
while (pec)
{
if (tec == pec) return EINA_TRUE;
pec = pec->parent;
}
return EINA_FALSE;
}
return EINA_FALSE;
}