e_service_launcher: block input while running custom transition animation 62/220762/3
authorMinJeong Kim <minjjj.kim@samsung.com>
Thu, 19 Dec 2019 05:07:24 +0000 (14:07 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Mon, 23 Dec 2019 07:59:22 +0000 (07:59 +0000)
Change-Id: I1dbf0016b8ed2d9b7330d1582aadb9b0cd8e3f7c
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/services/e_service_launcher.c

index 583bd1e..0dd2a6b 100644 (file)
@@ -47,6 +47,8 @@ struct _E_Service_Launcher
 
    Eina_Bool                            with_swl;       //it's for shared widget launch
    Eina_Bool                            swl_done;       //flag indicating done of callee
+
+   Eina_Bool                            block_input;    //input is blocked(1) or not(0) while running client side animation
 };
 
 struct _E_Service_Launcher_Handler
@@ -98,6 +100,38 @@ _launcher_clients_find_by_pid(pid_t pid)
    return clients;
 }
 
+
+static void
+_launcher_cb_input_block_expired(void *data)
+{
+   E_Service_Launcher *lc = (E_Service_Launcher*)data;
+   EINA_SAFETY_ON_NULL_RETURN(lc);
+
+   lc->block_input = EINA_FALSE;
+
+   ELOGF("LAUNCHER_SRV", "Input block EXPIRED", lc->ec);
+}
+
+static Eina_Bool
+_launcher_input_block_set(E_Service_Launcher *lc, Eina_Bool set)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(lc, EINA_FALSE);
+
+   if (set)
+     {
+        //request for block all input
+        lc->block_input = e_devicemgr_block_internal_add(ECORE_DEVICE_CLASS_NONE,
+                                                         EINA_TRUE,
+                                                         (uint32_t)(e_policy_visibility_timeout_get() * 1000),
+                                                         _launcher_cb_input_block_expired, lc);
+        return lc->block_input;
+     }
+   else
+     {
+        return e_devicemgr_block_internal_remove(_launcher_cb_input_block_expired, lc);
+     }
+}
+
 static const char*
 _launcher_state_to_str(Launcher_State state)
 {
@@ -157,6 +191,9 @@ _launcher_post_forward(E_Service_Launcher *lc, Eina_Bool success)
    if ((!success) && (target_ec))
      e_policy_animatable_lock(target_ec, E_POLICY_ANIMATABLE_CUSTOMIZED, 0);
 
+   if (!_launcher_input_block_set(lc, EINA_FALSE))
+     ELOGF("LAUNCHER_SRV", "Input block remove FAIL...", lc->ec);
+
    if (lc->vis_grab)
      e_policy_visibility_client_grab_release(lc->vis_grab);
    if (lc->target.vis_grab)
@@ -210,6 +247,9 @@ _launcher_post_backward(E_Service_Launcher *lc, Eina_Bool success)
    if ((!success) && (target_ec))
      e_policy_animatable_lock(target_ec, E_POLICY_ANIMATABLE_CUSTOMIZED, 0);
 
+   if (!_launcher_input_block_set(lc, EINA_FALSE))
+     ELOGF("LAUNCHER_SRV", "Input block remove FAIL...", lc->ec);
+
    if (lc->vis_grab)
      e_policy_visibility_client_grab_release(lc->vis_grab);
    if (lc->target.vis_grab)
@@ -363,6 +403,9 @@ _launcher_prepare_shared_widget_forward_send(E_Service_Launcher *lc,
              __func__);
      }
 
+   if (!_launcher_input_block_set(lc, EINA_TRUE))
+     ELOGF("LAUNCHER_SRV", "Input block add FAIL...", lc->ec);
+
    _launcher_launched_ec_set(lc, NULL);
    _launcher_target_ec_set(lc, target_ec);
 
@@ -416,6 +459,9 @@ _launcher_prepare_shared_widget_backward_send(E_Service_Launcher *lc,
         lc->target.vis_grab = e_policy_visibility_client_filtered_grab_get(target_ec, job_type, __func__);
      }
 
+   if (!_launcher_input_block_set(lc, EINA_TRUE))
+     ELOGF("LAUNCHER_SRV", "Input block add FAIL...", lc->ec);
+
    _launcher_launched_ec_set(lc, NULL);
    _launcher_target_ec_set(lc, target_ec);
 
@@ -458,6 +504,9 @@ _launcher_prepare_forward_send(E_Service_Launcher *lc,
                                                                          E_VIS_JOB_TYPE_UNICONIFY_BY_VISIBILITY),
                                                                         __func__);
 
+   if (!_launcher_input_block_set(lc, EINA_TRUE))
+     ELOGF("LAUNCHER_SRV", "Input block add FAIL...", lc->ec);
+
    _launcher_launched_ec_set(lc, NULL);
    _launcher_target_ec_set(lc, target_ec);
 
@@ -512,6 +561,9 @@ _launcher_prepare_backward_send(E_Service_Launcher *lc,
         lc->target.vis_grab = e_policy_visibility_client_filtered_grab_get(target_ec, job_type, __func__);
      }
 
+   if (!_launcher_input_block_set(lc, EINA_TRUE))
+     ELOGF("LAUNCHER_SRV", "Input block add FAIL...", lc->ec);
+
    _launcher_launched_ec_set(lc, NULL);
    _launcher_target_ec_set(lc, target_ec);