From: Doyoun Kang Date: Tue, 16 Jul 2024 01:07:16 +0000 (+0900) Subject: e_client: add E_Alpha_Opaque enumeration X-Git-Tag: accepted/tizen/unified/20240717.060618~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=028b38c76317ce5576d1b24273d8b51db50d7526;p=platform%2Fupstream%2Fenlightenment.git e_client: add E_Alpha_Opaque enumeration Change-Id: If3d804c8246550547d0ddf556b287f9408e2ca56 --- diff --git a/src/bin/core/e_client.c b/src/bin/core/e_client.c index 9df9b5bbe5..a8fe00ca6a 100644 --- a/src/bin/core/e_client.c +++ b/src/bin/core/e_client.c @@ -855,7 +855,7 @@ e_client_check_obscured_by_children_group(E_Client *ec) 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; + if (cec->visibility.opaque == E_ALPHA_OPAQUE_SET) break; } } @@ -3337,7 +3337,7 @@ e_client_new(E_Pixmap *cp, int first_map, int internal) ec->netwm.opacity = 255; ec->visibility.obscured = E_VISIBILITY_UNKNOWN; - ec->visibility.opaque = -1; + ec->visibility.opaque = E_ALPHA_OPAQUE_UNKNOWN; ec->visibility.changed = 0; ec->visibility.skip = 0; ec->visibility.last_sent_type = E_VISIBILITY_UNKNOWN; @@ -8220,15 +8220,15 @@ e_client_visibility_force_obscured_get(E_Client *ec) } E_API void -e_client_visibility_opaque_state_set(E_Client *ec, int opaque) +e_client_visibility_alpha_opaque_set(E_Client *ec, E_Alpha_Opaque opaque) { if (ec) ec->visibility.opaque = opaque; } -E_API Eina_Bool -e_client_visibility_opaque_state_get(E_Client *ec, int *opaque) +E_API E_Alpha_Opaque +e_client_visibility_alpha_opaque_get(E_Client *ec) { - if (!ec) return EINA_FALSE; + if (!ec) return E_ALPHA_OPAQUE_UNKNOWN; return ec->visibility.opaque; } diff --git a/src/bin/core/e_zone.c b/src/bin/core/e_zone.c index e872931050..fbf781b267 100644 --- a/src/bin/core/e_zone.c +++ b/src/bin/core/e_zone.c @@ -2039,7 +2039,7 @@ e_zone_visibility_calculate(E_Zone *zone) if (canvas_vis && !skip_by_pending_show && !is_vis_on_skip) { /* check alpha window is opaque or not. */ - if ((ec->visibility.opaque > 0) && (ec->argb)) + if ((ec->visibility.opaque == E_ALPHA_OPAQUE_SET) && (ec->argb)) ec_opaque = EINA_TRUE; /* if e_client is not alpha or opaque then delete intersect rect */ diff --git a/src/bin/server/e_policy_wl.c b/src/bin/server/e_policy_wl.c index 1c46c5d6a5..7878efcce8 100644 --- a/src/bin/server/e_policy_wl.c +++ b/src/bin/server/e_policy_wl.c @@ -2361,18 +2361,26 @@ _tzpol_iface_cb_subsurface_get(struct wl_client *client, struct wl_resource *res cdata->has_extern_parent = EINA_TRUE; } +static E_Alpha_Opaque +_e_policy_wl_convert_tz_opaque_to_alpha_opaque(int32_t tz_state) +{ + return (tz_state > 0) ? E_ALPHA_OPAQUE_SET : E_ALPHA_OPAQUE_UNSET; +} + static void _tzpol_iface_cb_opaque_state_set(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface, int32_t state) { E_Client *ec; + E_Alpha_Opaque alpha_opaque; ec = e_client_from_surface_resource(surface); EINA_SAFETY_ON_NULL_RETURN(ec); ELOGF("TZPOL", "OPAQUE |opaque_state:%d", ec, state); - if(ec->visibility.opaque == state) + alpha_opaque = _e_policy_wl_convert_tz_opaque_to_alpha_opaque(state); + if(ec->visibility.opaque == alpha_opaque) return; - ec->visibility.opaque = state; + ec->visibility.opaque = alpha_opaque; EC_CHANGED(ec); } diff --git a/src/bin/windowmgr/e_policy.c b/src/bin/windowmgr/e_policy.c index 2e2731def7..532ae1c50a 100644 --- a/src/bin/windowmgr/e_policy.c +++ b/src/bin/windowmgr/e_policy.c @@ -791,7 +791,7 @@ _e_policy_cb_hook_client_visibility(void *d EINA_UNUSED, E_Client *ec) if (above_ec->argb) { - if (above_ec->visibility.opaque <= 0) + if (above_ec->visibility.opaque != E_ALPHA_OPAQUE_SET) continue; else { diff --git a/src/bin/windowmgr/e_policy_stack.c b/src/bin/windowmgr/e_policy_stack.c index 6cc0411b62..18bacc73d0 100644 --- a/src/bin/windowmgr/e_policy_stack.c +++ b/src/bin/windowmgr/e_policy_stack.c @@ -592,7 +592,7 @@ e_policy_stack_clients_restack_above_lockscreen(E_Client *ec_lock, Eina_Bool sho if ((!ec->argb) || ((ec->argb) && - (ec->visibility.opaque == 1))) + (ec->visibility.opaque == E_ALPHA_OPAQUE_SET))) { e_client_geometry_get(ec, &x, &y, &w, &h); if (E_CONTAINS(x, y, w, h, zone->x, zone->y, zone->w, zone->h)) diff --git a/src/bin/windowmgr/e_policy_visibility.c b/src/bin/windowmgr/e_policy_visibility.c index 0a73678a9f..f85b893f3d 100644 --- a/src/bin/windowmgr/e_policy_visibility.c +++ b/src/bin/windowmgr/e_policy_visibility.c @@ -257,7 +257,7 @@ _e_policy_check_above_alpha_opaque(E_Client *ec) if (above_ec->argb) { - if (above_ec->visibility.opaque <= 0) + if (above_ec->visibility.opaque != E_ALPHA_OPAQUE_SET) continue; else { @@ -446,7 +446,7 @@ _e_policy_client_uniconify_by_visibility(E_Client *ec) e_policy_wl_iconify_state_change_send(ec, 0); } - if ((ec->visibility.opaque > 0) && (ec->argb)) + if ((ec->visibility.opaque == E_ALPHA_OPAQUE_SET) && (ec->argb)) { _e_policy_client_below_uniconify(ec); } @@ -1385,7 +1385,7 @@ _e_vis_client_check_obscured_by_children(E_Client *ec) } else { - if (child->visibility.opaque > 0) + if (child->visibility.opaque == E_ALPHA_OPAQUE_SET) { ELOGF("POL_VIS", "Fully Obscured by alpha opaque child (win:%zx, child:%p)", ec, e_client_util_win_get(child), child); @@ -1429,7 +1429,7 @@ _e_vis_client_check_obscured_by_same_layer(E_Client *ec) } else { - if (above->visibility.opaque <= 0) + if (above->visibility.opaque != E_ALPHA_OPAQUE_SET) continue; else { @@ -1475,7 +1475,7 @@ _e_vis_client_check_obscured_by_above_layers(E_Client *ec) } else { - if (above->visibility.opaque <= 0) + if (above->visibility.opaque != E_ALPHA_OPAQUE_SET) continue; else { @@ -1637,7 +1637,7 @@ _e_vis_ec_activity_check(E_Client *ec, Eina_Bool check_alpha, Eina_Bool check_fu /* check if ignored */ if (e_client_util_ignored_get(ec)) return EINA_FALSE; /* check transparent */ - if (check_alpha && ((ec->argb) && (ec->visibility.opaque <= 0))) return EINA_FALSE; + if (check_alpha && ((ec->argb) && (ec->visibility.opaque != E_ALPHA_OPAQUE_SET))) return EINA_FALSE; /* check deleted client */ if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; /* check launchscreen */ @@ -1804,7 +1804,7 @@ _e_vis_ec_above_visible_type(E_Client *ec, Eina_Bool check_child) above_vis_type = E_POL_VIS_TYPE_NON_ALPHA; else { - if (above->visibility.opaque > 0) + if (above->visibility.opaque == E_ALPHA_OPAQUE_SET) above_vis_type = E_POL_VIS_TYPE_ALPHA_OPAQUE; continue; @@ -1834,7 +1834,7 @@ _e_vis_client_check_obscure_below(E_Client *ec) if (ec->iconic && e_client_is_iconified_by_client(ec)) return EINA_FALSE; if (ec->bg_state) return EINA_FALSE; if (ec->comp_data && !ec->comp_data->mapped) return EINA_FALSE; - if ((ec->argb) && (ec->visibility.opaque <= 0)) return EINA_FALSE; + if ((ec->argb) && (ec->visibility.opaque != E_ALPHA_OPAQUE_SET)) return EINA_FALSE; if (e_client_visibility_get(ec) != E_VISIBILITY_UNOBSCURED) return EINA_FALSE; if (!ec->visible) return EINA_FALSE; @@ -1911,7 +1911,8 @@ _e_vis_ec_below_activity_clients_get(E_Client *ec, Eina_List **below_list) if (!below->internal) *below_list = eina_list_prepend(*below_list, vc); - if (!(below->argb) || !(below->visibility.opaque <= 0)) + + if (!(below->argb) || !(below->visibility.opaque != E_ALPHA_OPAQUE_SET)) { eina_tiler_union(above_tile, below_tile); diff --git a/src/include/e_client.h b/src/include/e_client.h index 5c6a51780a..18ff3dd2d5 100644 --- a/src/include/e_client.h +++ b/src/include/e_client.h @@ -200,6 +200,13 @@ typedef enum _E_Visibility E_VISIBILITY_PRE_UNOBSCURED = 3, } E_Visibility; +typedef enum _E_Alpha_Opaque +{ + E_ALPHA_OPAQUE_UNKNOWN = -1, + E_ALPHA_OPAQUE_UNSET = 0, + E_ALPHA_OPAQUE_SET = 1, +} E_Alpha_Opaque; + typedef enum _E_Changable_Layer_Type { E_CHANGABLE_LAYER_TYPE_TRANSIENT = 0, @@ -709,7 +716,7 @@ struct _E_Client struct { - int opaque; + E_Alpha_Opaque opaque; int obscured; unsigned char changed : 1; Eina_Bool skip : 1; @@ -1392,8 +1399,8 @@ E_API Eina_Bool e_client_user_skip_add_to_winlist_get(E_Client *ec); E_API Eina_Bool e_client_visibility_changed_get(E_Client *ec); E_API Eina_Bool e_client_visibility_force_obscured_get(E_Client *ec); -E_API Eina_Bool e_client_visibility_opaque_state_get(E_Client *ec, int *opaque); -E_API void e_client_visibility_opaque_state_set(E_Client *ec, int opaque); +E_API E_Alpha_Opaque e_client_visibility_alpha_opaque_get(E_Client *ec); +E_API void e_client_visibility_alpha_opaque_set(E_Client *ec, int opaque); E_API void e_client_visibility_obscured_set(E_Client *ec, E_Visibility obscured); E_API E_Visibility e_client_visibility_obscured_get(E_Client *ec); E_API Eina_Bool e_client_visibility_skip_get(E_Client *ec);