e_client: consider ec's zone size when check fully contain by above 58/192658/2
authorJunSeok, Kim <juns.kim@samsung.com>
Wed, 7 Nov 2018 10:05:04 +0000 (19:05 +0900)
committerJunSeok, Kim <juns.kim@samsung.com>
Thu, 8 Nov 2018 01:16:43 +0000 (10:16 +0900)
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

index 8878996..f40fb7f 100644 (file)
@@ -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);