From ca5176e6fa13c22d29629a1d9fc2b788b928643a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 30 Nov 2016 12:46:54 -0500 Subject: [PATCH] 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 --- src/bin/e_comp_wl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 801e83bea..4fc66f61d 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -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; }