e_client: refactor check_obscured_by_children_group 36/296736/2
authorJunseok Kim <juns.kim@samsung.com>
Tue, 1 Aug 2023 06:54:51 +0000 (15:54 +0900)
committerJunSeok Kim <juns.kim@samsung.com>
Fri, 4 Aug 2023 00:36:16 +0000 (00:36 +0000)
Change-Id: Icb5edb65d5b2bea73b392f198fcd3bc5cc2b06a7

src/bin/e_client.c

index 5994c0f..cec8c5d 100644 (file)
@@ -813,22 +813,18 @@ _e_client_check_obscured_by_children_group(E_Client *ec)
    Eina_List *transients = NULL, *l = NULL;
 
    _e_client_transient_for_group_make(ec, &transients);
+   if (!transients) return NULL;
 
    EINA_LIST_FOREACH(transients, l, cec)
      {
-        if (e_client_transient_policy_get(cec) == E_TRANSIENT_BELOW)
-          continue;
-
-        if (!E_CONTAINS(cec->x, cec->y, cec->w, cec->h, ec->x, ec->y, ec->w, ec->h))
-          continue;
-
-        if (!cec->argb) goto finish;
-        else if (cec->visibility.opaque > 0) goto finish;
+        if (E_CONTAINS(cec->x, cec->y, cec->w, cec->h, ec->x, ec->y, ec->w, ec->h))
+          {
+            if (!cec->argb) break;
+            if (cec->visibility.opaque > 0) break;
+          }
      }
 
-finish:
-   if (transients)
-     eina_list_free(transients);
+   eina_list_free(transients);
 
    return cec;
 }
@@ -3277,10 +3273,11 @@ _e_client_transient_for_group_make(E_Client *ec, Eina_List **list)
      {
         if (!child) continue;
         if (child->iconic) continue;
-        if (e_client_transient_policy_get(child) == E_TRANSIENT_BELOW) continue;
-
-        *list = eina_list_prepend(*list, child);
-        _e_client_transient_for_group_make(child, list);
+        if (e_client_transient_policy_get(child) == E_TRANSIENT_ABOVE)
+          {
+             *list = eina_list_prepend(*list, child);
+             _e_client_transient_for_group_make(child, list);
+          }
      }
 }