e_policy_visibility: check if the window is under pending hide in intercept hide... 70/169170/2
authorDoyoun Kang <doyoun.kang@samsung.com>
Fri, 2 Feb 2018 11:36:49 +0000 (20:36 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 5 Feb 2018 01:56:25 +0000 (10:56 +0900)
There was a bug that the pending hide window was shown if the window was request to hide
one more time.

Change-Id: I43ea491483741c0c3eb500e96dfd2df783d7785a

src/bin/e_policy_visibility.c

index 12cff8a1e7cd78c3d60b1454ea73e7d767e8ce49..3592de9760de1ed4ff57997e0d8c2860ac72b974 100644 (file)
@@ -536,6 +536,27 @@ _e_vis_job_push(E_Vis_Job *job)
    return EINA_TRUE;
 }
 
+static Eina_Bool
+_e_vis_job_find(E_Vis_Client *vc, E_Vis_Job_Type type)
+{
+   E_Vis_Job_Group *group, *tmp_group;
+   E_Vis_Job *job, *tmp_job;
+
+   EINA_CLIST_FOR_EACH_ENTRY_SAFE(group, tmp_group,
+                                  &pol_job_group_head, E_Vis_Job_Group, entry)
+     {
+        EINA_CLIST_FOR_EACH_ENTRY_SAFE(job, tmp_job,
+                                       &group->job_head, E_Vis_Job, entry)
+          {
+             if (job->vc != vc) continue;
+             if (job->type == type)
+               return EINA_TRUE;
+          }
+     }
+
+   return EINA_FALSE;
+}
+
 static Eina_Bool
 _e_vis_job_add(E_Vis_Client *vc, E_Vis_Job_Type type, Ecore_Task_Cb timeout_func)
 {
@@ -1744,6 +1765,12 @@ _e_vis_intercept_hide(void *data EINA_UNUSED, E_Client *ec)
 
    VS_DBG(ec, "INTERCEPTOR HIDE");
 
+   if (_e_vis_job_find(vc, E_VIS_JOB_TYPE_HIDE))
+     {
+        VS_INF(ec, "Already Pending HIDE...");
+        return EINA_FALSE;
+     }
+
    /* find activity client among the clients to be lower */
    if (!_e_vis_ec_foreground_check(ec, !!e_config->transient.raise))
      {