From 182abf56e58c7f4c3c2b703573115f41b5f82165 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Tue, 14 Apr 2020 17:11:22 +0900 Subject: [PATCH] e_hwc_windows: set client type if client is obscured by target Change-Id: I4be0bf6fd42804a056527eedc563d17521e19977 --- src/bin/e_hwc_window.c | 10 ++++++++++ src/bin/e_hwc_window.h | 3 ++- src/bin/e_hwc_windows.c | 32 ++++++++++++++++++++++++++------ 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/bin/e_hwc_window.c b/src/bin/e_hwc_window.c index 50f1812826..4bf161cc4c 100644 --- a/src/bin/e_hwc_window.c +++ b/src/bin/e_hwc_window.c @@ -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"; } diff --git a/src/bin/e_hwc_window.h b/src/bin/e_hwc_window.h index ec86292da9..d53f04f0a2 100644 --- a/src/bin/e_hwc_window.h +++ b/src/bin/e_hwc_window.h @@ -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 diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index d5284d4204..dea22e7216 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -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; } -- 2.34.1