e_client/comp/policy: do not map the window after getting hide request 97/302197/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Sun, 3 Dec 2023 05:54:19 +0000 (14:54 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 4 Dec 2023 02:40:03 +0000 (11:40 +0900)
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
src/bin/e_client.h
src/bin/e_comp_wl.c
src/bin/e_policy_wl.c

index e40fa83..72b8d76 100644 (file)
@@ -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)
 {
index 175af60..1b2c302 100644 (file)
@@ -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);
index bdfadc0..1f698d9 100644 (file)
@@ -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);
index 19349c6..2c9c0c4 100644 (file)
@@ -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