e_policy: Added interceptor for activate above/below
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 17 May 2017 04:59:04 +0000 (13:59 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 5 Jul 2017 08:47:27 +0000 (17:47 +0900)
Change-Id: I0f840cc2a2816561ec98380fc8dc526f6abaace5

src/bin/e_policy.c
src/bin/e_policy.h
src/bin/e_policy_wl.c

index ebbbd9c476d5d45f73f78795fdf8d72fed10675e..df8f32d5e44d082a3bcfcb3f8ad4cf4b7645d9f6 100644 (file)
@@ -20,6 +20,8 @@ E_Policy_Interceptor *_e_policy_interceptors[] =
 {
    [E_POLICY_INTERCEPT_LAUNCHSCREEN_OBJECT_SETUP] = NULL,
    [E_POLICY_INTERCEPT_STACK_TRANSIENT_FOR] = NULL,
+   [E_POLICY_INTERCEPT_ACTIVATE_ABOVE] = NULL,
+   [E_POLICY_INTERCEPT_ACTIVATE_BELOW] = NULL,
 };
 
 static Eina_List *handlers = NULL;
index 7506b2b707621ea1296549c82ce48fa15078cad8..027ed80c363ea402408010330edc9ed7b67eea33 100644 (file)
@@ -13,6 +13,8 @@ typedef enum _E_Policy_Intercept_Point
 {
    E_POLICY_INTERCEPT_LAUNCHSCREEN_OBJECT_SETUP,
    E_POLICY_INTERCEPT_STACK_TRANSIENT_FOR,
+   E_POLICY_INTERCEPT_ACTIVATE_ABOVE,
+   E_POLICY_INTERCEPT_ACTIVATE_BELOW,
    E_POLICY_INTERCEPT_LAST,
 } E_Policy_Intercept_Point;
 
index 199cb3567ddae3468e936281ca0d6f353ab85f2a..28956314c3ed7ee1582ad7d8d148596b16c424ad 100644 (file)
@@ -1450,6 +1450,7 @@ _tzpol_iface_cb_activate_below_by_res_id(struct wl_client *client EINA_UNUSED, s
    E_Client *below_ec = NULL;
    E_Client *parent_ec = NULL;
    Eina_Bool check_ancestor = EINA_FALSE;
+   Eina_Bool intercepted = EINA_FALSE;
 
    ec = e_pixmap_find_client_by_res_id(res_id);
    EINA_SAFETY_ON_NULL_RETURN(ec);
@@ -1463,6 +1464,15 @@ _tzpol_iface_cb_activate_below_by_res_id(struct wl_client *client EINA_UNUSED, s
          "ACTIVATE_BELOW|win:0x%08x(res_id:%d)|below_win:0x%08x(res_id:%d)",
          NULL, NULL, e_client_util_win_get(ec), res_id, e_client_util_win_get(below_ec), below_res_id);
 
+   intercepted = e_policy_interceptor_call(E_POLICY_INTERCEPT_ACTIVATE_BELOW,
+                                           ec, below_ec);
+   if (intercepted)
+     {
+        ELOGF("TZPOL", "ACTIVATE_BELOW|Handled by Intercept function",
+              ec->pixmap, ec);
+        return;
+     }
+
    if (ec->layer > below_ec->layer) return;
 
    parent_ec = ec->parent;
@@ -1500,6 +1510,7 @@ _tzpol_iface_cb_activate_above_by_res_id(struct wl_client *client EINA_UNUSED, s
    E_Client *above_ec = NULL;
    E_Client *parent_ec = NULL;
    Eina_Bool check_ancestor = EINA_FALSE;
+   Eina_Bool intercepted = EINA_FALSE;
 
    ec = e_pixmap_find_client_by_res_id(res_id);
    EINA_SAFETY_ON_NULL_RETURN(ec);
@@ -1513,6 +1524,15 @@ _tzpol_iface_cb_activate_above_by_res_id(struct wl_client *client EINA_UNUSED, s
          "ACTIVATE_ABOVE|win:0x%08x(res_id:%d)|above_win:0x%08x(res_id:%d)",
          NULL, NULL, e_client_util_win_get(ec), res_id, e_client_util_win_get(above_ec), above_res_id);
 
+   intercepted = e_policy_interceptor_call(E_POLICY_INTERCEPT_ACTIVATE_ABOVE,
+                                           ec, above_ec);
+   if (intercepted)
+     {
+        ELOGF("TZPOL", "ACTIVATE_ABOVE|Handled by Intercept function",
+              ec->pixmap, ec);
+        return;
+     }
+
    if (ec->layer < above_ec->layer) return;
 
    /* check child */