e_hwc_windows: set client type if client is obscured by target 16/230916/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 14 Apr 2020 08:11:22 +0000 (17:11 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 16 Apr 2020 05:11:24 +0000 (14:11 +0900)
Change-Id: I4be0bf6fd42804a056527eedc563d17521e19977

src/bin/e_hwc_window.c
src/bin/e_hwc_window.h
src/bin/e_hwc_windows.c

index 50f1812826d3322538386e52bb1e2a7330ab5e60..4bf161cc4cbde58d35c15ea88c9a186240f00141 100644 (file)
@@ -89,6 +89,7 @@ typedef enum _E_Hwc_Window_Restriction
    E_HWC_WINDOW_RESTRICTION_CONTENT_IMAGE,
    E_HWC_WINDOW_RESTRICTION_QUICKPANEL_OPEN,
    E_HWC_WINDOW_RESTRICTION_PIXMAP_RESOURCE,
+   E_HWC_WINDOW_RESTRICTION_OBSCURED_BY_TARGET,
 } E_Hwc_Window_Restriction;
 
 static Eina_Bool ehw_trace = EINA_FALSE;
@@ -1746,6 +1747,13 @@ e_hwc_window_device_state_available_update(E_Hwc_Window *hwc_window)
         goto finish;
      }
 
+   if (hwc_window->obscured_by_target)
+     {
+        restriction = E_HWC_WINDOW_RESTRICTION_OBSCURED_BY_TARGET;
+        available = EINA_FALSE;
+        goto finish;
+     }
+
    if (e_comp_object_is_animating(ec->frame))
      {
         restriction = E_HWC_WINDOW_RESTRICTION_ANIMATING;
@@ -2230,6 +2238,8 @@ e_hwc_window_restriction_string_get(E_Hwc_Window *hwc_window)
        return "quickpanel open";
      case E_HWC_WINDOW_RESTRICTION_PIXMAP_RESOURCE:
        return "pixmap resource";
+     case E_HWC_WINDOW_RESTRICTION_OBSCURED_BY_TARGET:
+       return "obscured by target";
      default:
        return "UNKNOWN";
     }
index ec86292da94efdc7661fd1823f0be11e4299fcd3..d53f04f0a2f4fb5bca949cd199057dc3da261219 100644 (file)
@@ -142,8 +142,9 @@ struct _E_Hwc_Window
    Eina_Bool                      on_rendered_target;
 
    unsigned int                   restriction;
+   Eina_Bool                      obscured_by_target;
 
-   E_Presentation_Time_Container presentation_container;
+   E_Presentation_Time_Container  presentation_container;
 };
 
 struct _E_Hwc_Window_Target
index d5284d4204a58ee50ba627783e5d3c38c7cd5a68..dea22e72162bef9aac70d1c77cfc451df2608bcc 100644 (file)
@@ -761,20 +761,41 @@ _e_hwc_windows_visible_windows_list_get(E_Hwc *hwc)
    E_Hwc_Window *hwc_window;
    E_Client  *ec;
    Evas_Object *o;
-   int scr_w, scr_h;
+   int ee_w, ee_h;
    int x, y, w, h;
+   int r, g, b, a;
    int ui_skip = EINA_FALSE;
+   int obscured_by_target = EINA_FALSE;
+   const char *type = NULL;
+
+   ecore_evas_geometry_get(e_comp->ee, NULL, NULL, &ee_w, &ee_h);
 
    for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
      {
         ec = _e_hwc_windows_client_get_from_object(o);
+        if (!ec)
+          {
+             if (obscured_by_target) continue;
 
-        if (!ec) continue;
-        if (!ec->hwc_window) continue;
+             type = evas_object_type_get(o);
+             if (!e_util_strcmp(type, "image"))
+               {
+                  evas_object_color_get(o, &r, &g, &b, &a);
+                  evas_object_geometry_get(o, &x, &y, &w, &h);
+
+                  if ((a > 0) && ((r > 0)  || (g > 0) || (b > 0)) &&
+                      (E_INTERSECTS(0, 0, ee_w, ee_h, x, y, w, h)))
+                    obscured_by_target = EINA_TRUE;
+               }
+
+             continue;
+          }
 
         hwc_window = ec->hwc_window;
+        if (!hwc_window) continue;
 
         e_hwc_window_name_set(hwc_window);
+        hwc_window->obscured_by_target = obscured_by_target;
 
         // check clients to skip composite
         if (e_client_util_ignored_get(ec))
@@ -797,8 +818,7 @@ _e_hwc_windows_visible_windows_list_get(E_Hwc *hwc)
 
         // check geometry if located out of screen such as quick panel
         e_client_geometry_get(ec, &x, &y, &w, &h);
-        ecore_evas_geometry_get(e_comp->ee, NULL, NULL, &scr_w, &scr_h);
-        if (!E_INTERSECTS(0, 0, scr_w, scr_h, x, y, w, h))
+        if (!E_INTERSECTS(0, 0, ee_w, ee_h, x, y, w, h))
           {
              e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_NONE, EINA_TRUE);
              continue;
@@ -838,7 +858,7 @@ _e_hwc_windows_visible_windows_list_get(E_Hwc *hwc)
           windows_list = eina_list_append(windows_list, hwc_window);
 
         if ((!ec->argb) &&
-            (E_CONTAINS(x, y, w, h, 0, 0, scr_w, scr_h)) &&
+            (E_CONTAINS(x, y, w, h, 0, 0, ee_w, ee_h)) &&
             (!e_comp_object_is_animating(ec->frame)))
           ui_skip = EINA_TRUE;
      }