From a2f12ff16261b1ead5ef19441a183e49dcbe26bb Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Sun, 3 Dec 2023 14:54:19 +0900 Subject: [PATCH] e_client/comp/policy: do not map the window after getting hide request We add the hide_by_request flag in the E_Client_Private. This flag is set when the enlightenment receives the tizen_policy_hide request and unset when the tizen_policy_show request is received. If this flag is set, the enlightenment does not map the window even if a buffer attach occurs. Change-Id: Ib646c3cd6d3874ee3bf4f8ff46dc1e02fcdf872a --- src/bin/e_client.c | 14 ++++++++++++++ src/bin/e_client.h | 2 ++ src/bin/e_comp_wl.c | 14 ++++++++++++-- src/bin/e_policy_wl.c | 2 ++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index e40fa83..72b8d76 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -77,6 +77,8 @@ struct _E_Client_Private struct wl_signal stick; struct wl_signal unstick; } events; + + Eina_Bool hide_by_request; }; static int _e_client_hooks_delete = 0; @@ -4447,6 +4449,18 @@ E_API Eina_Bool e_client_is_iconified_by_client(E_Client *ec) /////////////////////////////////////// +EINTERN void e_client_hide_by_request_set(E_Client *ec, Eina_Bool set) +{ + API_ENTRY; + priv->hide_by_request = set; +} + +EINTERN Eina_Bool e_client_hide_by_request_get(E_Client *ec) +{ + API_ENTRY_VAL(EINA_FALSE); + return priv->hide_by_request; +} + EINTERN void e_client_urgent_set(E_Client *ec, Eina_Bool urgent) { diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 175af60..1b2c302 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -1139,6 +1139,8 @@ E_API void e_client_uniconify(E_Client *ec); E_API void e_client_iconified_type_set(E_Client *ec, E_Iconified_Type type); EINTERN E_Iconified_Type e_client_iconified_type_get(E_Client *ec); E_API Eina_Bool e_client_is_iconified_by_client(E_Client *ec); +EINTERN void e_client_hide_by_request_set(E_Client *ec, Eina_Bool set); +EINTERN Eina_Bool e_client_hide_by_request_get(E_Client *ec); EINTERN void e_client_urgent_set(E_Client *ec, Eina_Bool urgent); EINTERN void e_client_stick(E_Client *ec); EINTERN void e_client_unstick(E_Client *ec); diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index bdfadc0..1f698d9 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -2936,11 +2936,16 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) } /* map or unmap ec */ - if (!e_pixmap_usable_get(ec->pixmap)) + Eina_Bool pixmap_usable = e_pixmap_usable_get(ec->pixmap); + Eina_Bool hide_by_request = e_client_hide_by_request_get(ec); + if (!pixmap_usable || hide_by_request) { /* unmap ec */ if (cdata->mapped) { + if (hide_by_request) + ELOGF("COMP", "Currenlty hide_by_request state. pixmap_usable:%d", ec, pixmap_usable); + if ((cdata->shell.surface) && (cdata->shell.unmap)) { @@ -4059,10 +4064,15 @@ e_comp_wl_surface_commit(E_Client *ec) e_comp_wl_subsurface_restack_bg_rectangle(topmost); } - if (!e_pixmap_usable_get(ec->pixmap)) + Eina_Bool pixmap_usable = e_pixmap_usable_get(ec->pixmap); + Eina_Bool hide_by_request = e_client_hide_by_request_get(ec); + if (!pixmap_usable || hide_by_request) { if (ec->comp_data->mapped) { + if (hide_by_request) + ELOGF("COMP", "Currenlty hide_by_request state2. pixmap_usable:%d", ec, pixmap_usable); + if ((ec->comp_data->shell.surface) && (ec->comp_data->shell.unmap)) { ELOGF("COMP", "Try to unmap2. Call shell.unmap.", ec); diff --git a/src/bin/e_policy_wl.c b/src/bin/e_policy_wl.c index 19349c6..2c9c0c4 100644 --- a/src/bin/e_policy_wl.c +++ b/src/bin/e_policy_wl.c @@ -3491,6 +3491,7 @@ _tzpol_iface_cb_show(struct wl_client *client EINA_UNUSED, struct wl_resource *r EINA_SAFETY_ON_NULL_RETURN(ec->frame); ELOGF("TZPOL", "Prepare SHOW (wait for buffer attach)", ec); + e_client_hide_by_request_set(ec, EINA_FALSE); cdata = e_client_cdata_get(ec); if (cdata && !cdata->mapped) @@ -3513,6 +3514,7 @@ _tzpol_iface_cb_hide(struct wl_client *client EINA_UNUSED, struct wl_resource *r EINA_SAFETY_ON_NULL_RETURN(ec->frame); ELOGF("TZPOL", "Prepare HIDE (wait for NULL buffer attach)", ec); + e_client_hide_by_request_set(ec, EINA_TRUE); } static void -- 2.7.4