From 9ab68320bc3e59e8e44cff97dbbfdb1175387499 Mon Sep 17 00:00:00 2001 From: "JunSeok, Kim" Date: Wed, 7 Nov 2018 19:05:04 +0900 Subject: [PATCH] e_client: consider ec's zone size when check fully contain by above there was a irregular focus bug during check fully contain by above. when the below ec's size is bigger then above ec and display size, the function returns it isn't fully covered by above window despite the above is fullsize window. so, corrected this bug with clip the below ec's size to their zone size. Change-Id: I0e136409ee85b939eaf39d307e0b90fbcbcb800e --- src/bin/e_client.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 8878996..f40fb7f 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -787,9 +787,22 @@ static E_Client * _e_client_check_fully_contain_by_above(E_Client *ec, Eina_Bool check_layer) { E_Client *above = NULL; + E_Zone *_z = NULL; + int x = 0, y = 0, w = 0, h = 0; if (!ec) return NULL; + x = ec->x; + y = ec->y; + w = ec->w; + h = ec->h; + + if (ec->zone) + { + _z = ec->zone; + E_RECTS_CLIP_TO_RECT(x, y, w, h, _z->x, _z->y, _z->w, _z->h); + } + above = e_client_above_get(ec); while (above) { @@ -807,7 +820,7 @@ _e_client_check_fully_contain_by_above(E_Client *ec, Eina_Bool check_layer) (above->frame) && (above->icccm.accepts_focus || above->icccm.take_focus)) { - if (E_CONTAINS(above->x, above->y, above->w, above->h, ec->x, ec->y, ec->w, ec->h)) + if (E_CONTAINS(above->x, above->y, above->w, above->h, x, y, w, h)) break; } above = e_client_above_get(above); -- 2.7.4