e_policy_visibility: check partial window when running uniconify_render 95/226195/1
authorJunseok, Kim <juns.kim@samsung.com>
Thu, 27 Feb 2020 06:10:17 +0000 (15:10 +0900)
committerJunSeok Kim <juns.kim@samsung.com>
Thu, 27 Feb 2020 11:11:44 +0000 (11:11 +0000)
Change-Id: Iebb00642ae5ddd0dd43e65337f5b111e5207878c

src/bin/e_policy_visibility.c

index 295569b..b3dbc58 100644 (file)
@@ -50,7 +50,7 @@ static void              _e_vis_client_grab_remove(E_Vis_Client *vc, E_Vis_Grab
 static Eina_Bool         _e_vis_client_grab_cancel(E_Vis_Client *vc);
 static void              _e_vis_client_job_exec(E_Vis_Client *vc, E_Vis_Job_Type type);
 static Eina_Bool         _e_vis_grab_job_filter(E_Vis_Grab *grab, E_Vis_Job_Type type);
-static Eina_Bool         _e_vis_ec_activity_check(E_Client *ec, Eina_Bool check_alpha);
+static Eina_Bool         _e_vis_ec_activity_check(E_Client *ec, E_Client *above, Eina_Bool check_alpha);
 static void              _e_vis_ec_job_exec(E_Client *ec, E_Vis_Job_Type type);
 static void              _e_vis_ec_setup(E_Client *ec);
 static void              _e_vis_ec_reset(E_Client *ec);
@@ -520,7 +520,7 @@ _e_vis_update_forground_list(void)
         if (!evas_object_visible_get(ec->frame)) continue;
 
         pol_vis->fg_clients = eina_list_append(pol_vis->fg_clients, ec);
-        if (_e_vis_ec_activity_check(ec, EINA_TRUE))
+        if (_e_vis_ec_activity_check(ec, NULL, EINA_TRUE))
           {
              fg_activity = ec;
              break;
@@ -1518,12 +1518,25 @@ _e_vis_ec_size_is_full(E_Client *ec)
 }
 
 static Eina_Bool
-_e_vis_ec_activity_check(E_Client *ec, Eina_Bool check_alpha)
+_e_vis_ec_activity_check(E_Client *ec, E_Client *above, Eina_Bool check_alpha)
 {
    int x, y, w, h;
+   int ax, ay, aw, ah;
    E_Comp_Object_Content_Type type = E_COMP_OBJECT_CONTENT_TYPE_NONE;
    int check_mapped = 1;
 
+   if (above)
+     {
+        e_client_geometry_get(above, &ax, &ay, &aw, &ah);
+     }
+   else
+     {
+        ax = ec->desk->geom.x;
+        ay = ec->desk->geom.y;
+        aw = ec->desk->geom.w;
+        ah = ec->desk->geom.h;
+     }
+
    /* check if ignored */
    if (e_client_util_ignored_get(ec)) return EINA_FALSE;
    /* check transparent */
@@ -1545,7 +1558,9 @@ _e_vis_ec_activity_check(E_Client *ec, Eina_Bool check_alpha)
    if (_e_vis_ec_special_check(ec)) return EINA_FALSE;
    /* check if full screen */
    e_client_geometry_get(ec, &x, &y, &w, &h);
-   if (!E_CONTAINS(x, y, w, h, ec->desk->geom.x, ec->desk->geom.y, ec->desk->geom.w, ec->desk->geom.h))
+   E_RECTS_CLIP_TO_RECT(x, y, w, h, ec->desk->geom.x, ec->desk->geom.y, ec->desk->geom.w, ec->desk->geom.h);
+   E_RECTS_CLIP_TO_RECT(ax, ay, aw, ah, ec->desk->geom.x, ec->desk->geom.y, ec->desk->geom.w, ec->desk->geom.h);
+   if (!E_CONTAINS(ax, ay, aw, ah, x, y, w, h))
      return EINA_FALSE;
    /* check if obscured by force */
    if (ec->visibility.force_obscured)
@@ -1723,7 +1738,7 @@ _e_vis_ec_below_activity_clients_get(E_Client *ec, Eina_List **below_list)
 
    for (below = e_client_below_get(ec); below; below = e_client_below_get(below))
      {
-        if (!_e_vis_ec_activity_check(below, EINA_FALSE)) continue;
+        if (!_e_vis_ec_activity_check(below, ec, EINA_FALSE)) continue;
 
         E_VIS_CLIENT_GET(vc, below);
         if (!vc) continue;
@@ -1755,13 +1770,8 @@ _e_vis_ec_below_uniconify(E_Client *ec, E_Pol_Vis_Type above_vis_type)
      {
         if (ec->zone->display_state == E_ZONE_DISPLAY_STATE_OFF)
           return EINA_FALSE;
-
-        /* if the ec is not fullfilling the screen, no needs to wait below clients' uniconify */
         if (ec->zone != e_zone_current_get())
           return EINA_FALSE;
-        e_client_geometry_get(ec, &x, &y, &w, &h);
-        if (!E_CONTAINS(x, y, w, h, ec->zone->x, ec->zone->y, ec->zone->w, ec->zone->h))
-          return EINA_FALSE;
      }
 
    /* find below activity clients */
@@ -2106,7 +2116,7 @@ E_API Eina_Bool
 e_policy_visibility_client_is_activity(E_Client *ec)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
-   return _e_vis_ec_activity_check(ec, EINA_TRUE);
+   return _e_vis_ec_activity_check(ec, NULL, EINA_TRUE);
 }
 
 E_API E_Vis_Grab *