e_policy_visibility: functionalization of job grab cancel 65/165565/2
authorJunSeok, Kim <juns.kim@samsung.com>
Fri, 29 Dec 2017 02:39:01 +0000 (11:39 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 10 Jan 2018 00:06:34 +0000 (00:06 +0000)
Change-Id: Ie1edc186770a3edb1464079bf2d24fd47ff42dcc
(cherry picked from commit 18b4b62af98e90ba44095e5e2925ffa82d44e05e)

src/bin/e_policy_visibility.c

index 9cef1ea7643a1fe27fbd05e90403f2b3d59f59bf..38fd6a8c1c6bc376b4e059e6853415dcffa1f3e5 100644 (file)
@@ -40,6 +40,7 @@ static void      _e_policy_client_uniconify_by_visibility(E_Client *ec);
 
 static inline Eina_Bool  _e_vis_client_is_grabbed(E_Vis_Client *vc);
 static void              _e_vis_client_grab_remove(E_Vis_Client *vc, E_Vis_Grab *grab);
+static void              _e_vis_client_grab_cancel(E_Vis_Client *vc);
 static void              _e_vis_client_job_exec(E_Vis_Client *vc, E_Vis_Job_Type type);
 static Eina_Bool         _e_vis_ec_activity_check(E_Client *ec, Eina_Bool check_alpha);
 static void              _e_vis_ec_job_exec(E_Client *ec, E_Vis_Job_Type type);
@@ -842,6 +843,18 @@ _e_vis_client_grab_get(E_Vis_Client *vc, const char *name)
    return grab;
 }
 
+static void
+_e_vis_client_grab_cancel(E_Vis_Client *vc)
+{
+   EINA_SAFETY_ON_NULL_RETURN(vc);
+
+   if (_e_vis_client_is_uniconify_render_running(vc))
+     {
+        VS_INF(vc->ec, "Visibility changed while waiting Uniconify. Release grab.");
+        E_FREE_FUNC(vc->grab, _e_vis_grab_release);
+     }
+}
+
 static void
 _e_vis_client_cb_evas_show(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
 {
@@ -1847,12 +1860,8 @@ e_policy_visibility_client_lower(E_Client *ec)
 
    VS_DBG(ec, "API ENTRY | LOWER");
 
-   /* if vc has job grab, remove them */
-   if (_e_vis_client_is_uniconify_render_running(vc))
-     {
-        VS_INF(ec, "Lower while waiting Uniconify. Release grab.");
-        E_FREE_FUNC(vc->grab, _e_vis_grab_release);
-     }
+   /* if vc has job grab, release them */
+   _e_vis_client_grab_cancel(vc);
 
    /* find activity client among the clients to be lower */
    if (!_e_vis_ec_foreground_check(ec, !!e_config->transient.lower))