e_policy_wl: handle show/hide request for tizen_policy interface 04/248504/3 accepted/tizen/unified/20201127.130445 submit/tizen/20201127.083508
authorDoyoun Kang <doyoun.kang@samsung.com>
Fri, 27 Nov 2020 07:26:24 +0000 (16:26 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Fri, 27 Nov 2020 08:25:05 +0000 (17:25 +0900)
This change is based on tizen_policy version 8.

Change-Id: I5b0936d2e22d2fc0238e6a36968e9707d3141553

src/bin/e_policy_wl.c

index a803c97fa43bff1c150709fda140a0773dba517e..3f752b3c65dae1bc4698af5ea2126d34874d9671 100644 (file)
@@ -3260,6 +3260,41 @@ _tzpol_iface_cb_set_appid(struct wl_client *client, struct wl_resource *res_tzpo
    e_appinfo_pid_set(eai, pid);
 }
 
+static void
+_tzpol_iface_cb_show(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol EINA_UNUSED, struct wl_resource *surf)
+{
+   E_Client *ec;
+   E_Comp_Wl_Client_Data *cdata;
+
+   ec = wl_resource_get_user_data(surf);
+   EINA_SAFETY_ON_NULL_RETURN(ec);
+   EINA_SAFETY_ON_NULL_RETURN(ec->frame);
+
+   ELOGF("TZPOL", "SHOW REQUEST", ec);
+
+   cdata = e_client_cdata_get(ec);
+   if (cdata && !cdata->mapped)
+     {
+        if (e_config->raise_before_show)
+          {
+             e_client_raise(ec);
+             ec->post_raise = EINA_FALSE;
+          }
+     }
+}
+
+static void
+_tzpol_iface_cb_hide(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzpol EINA_UNUSED, struct wl_resource *surf)
+{
+   E_Client *ec;
+
+   ec = wl_resource_get_user_data(surf);
+   EINA_SAFETY_ON_NULL_RETURN(ec);
+   EINA_SAFETY_ON_NULL_RETURN(ec->frame);
+
+   ELOGF("TZPOL", "HIDE REQUEST", ec);
+}
+
 // --------------------------------------------------------
 // tizen_policy_interface
 // --------------------------------------------------------
@@ -3305,6 +3340,8 @@ static const struct tizen_policy_interface _tzpol_iface =
    _tzpol_iface_cb_destroy,
    _tzpol_iface_cb_has_video,
    _tzpol_iface_cb_set_appid,
+   _tzpol_iface_cb_show,
+   _tzpol_iface_cb_hide,
 };
 
 static void
@@ -7677,7 +7714,7 @@ e_policy_wl_init(void)
    /* create globals */
    global = wl_global_create(e_comp_wl->wl.disp,
                              &tizen_policy_interface,
-                             7,
+                             8,
                              NULL,
                              _tzpol_cb_bind);
    EINA_SAFETY_ON_NULL_GOTO(global, err);