e_policy_visibility: apply to deiconify_approve for unsetting above_lock 37/108537/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Thu, 5 Jan 2017 04:03:20 +0000 (13:03 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Thu, 5 Jan 2017 04:03:20 +0000 (13:03 +0900)
There was a bug that the screen was blink when a window unset the above_lock and requested lower window.

Change-Id: I8dbcd6caf8df1ad32088e18a9a25f4aa10268380

src/bin/e_policy_visibility.c
src/bin/e_policy_visibility.h
src/bin/e_policy_visibility_internal.h
src/bin/e_policy_wl.c

index c65c56b..09e31fd 100644 (file)
@@ -428,7 +428,8 @@ _e_vis_job_add(E_Vis_Client *vc, E_Vis_Job_Type type, Ecore_Task_Cb timeout_func
    job->timer = ecore_timer_add(E_VIS_TIMEOUT, timeout_func, job);
 
    if ((job->type == E_VIS_JOB_TYPE_LOWER) ||
-       (job->type == E_VIS_JOB_TYPE_HIDE))
+       (job->type == E_VIS_JOB_TYPE_HIDE) ||
+       (job->type == E_VIS_JOB_TYPE_LAYER_LOWER))
      e_comp_canvas_norender_push();
 
    return EINA_TRUE;
@@ -442,7 +443,8 @@ _e_vis_job_del(Eina_Clist *elem)
    _e_vis_clist_unlink(elem);
    job = EINA_CLIST_ENTRY(elem, E_Vis_Job, entry);
    if ((job->type == E_VIS_JOB_TYPE_LOWER) ||
-       (job->type == E_VIS_JOB_TYPE_HIDE))
+       (job->type == E_VIS_JOB_TYPE_HIDE) ||
+       (job->type == E_VIS_JOB_TYPE_LAYER_LOWER))
      e_comp_canvas_norender_pop();
    E_FREE_FUNC(job->timer, ecore_timer_del);
    free(job);
@@ -994,6 +996,12 @@ _e_vis_ec_job_exec(E_Client *ec, E_Vis_Job_Type type)
          e_comp_canvas_norender_pop();
          evas_object_hide(ec->frame);
          break;
+      case E_VIS_JOB_TYPE_LAYER_LOWER:
+         e_comp_canvas_norender_pop();
+         E_VIS_CLIENT_GET(vc, ec);
+         if (vc)
+           evas_object_layer_set(ec->frame, vc->layer);
+         break;
       default:
          VS_ERR(ec, "Unkown job type: %d", type);
          break;
@@ -1355,6 +1363,35 @@ e_policy_visibility_client_activate(E_Client *ec)
    return ret;
 }
 
+E_API Eina_Bool
+e_policy_visibility_client_layer_lower(E_Client *ec, E_Layer layer)
+{
+   if (!e_config->use_buffer_flush) return EINA_FALSE;
+
+   E_VIS_CLIENT_GET_OR_RETURN_VAL(vc, ec, EINA_FALSE);
+
+   VS_DBG(ec, "API ENTRY | LAYER LOWER (layer:%d)", layer);
+
+   /* find activity client among the clients to be lower */
+   if (!_e_vis_ec_foreground_check(ec, !!e_config->transient.lower))
+     {
+        VS_INF(ec, "NO activity clients");
+        return EINA_FALSE;
+     }
+
+   if (!_e_vis_ec_below_uniconify(ec))
+     {
+        VS_DBG(ec, "Failed to uniconify below client");
+        return EINA_FALSE;
+     }
+
+   /* add lower lower job, it will be executed after below activity client finishs updating */
+   vc->layer = layer;
+   _e_vis_client_job_add(vc, E_VIS_JOB_TYPE_LAYER_LOWER);
+
+   return EINA_TRUE;
+}
+
 E_API void
 e_policy_visibility_uniconify_render_disable_set(E_Client *ec, Eina_Bool disable)
 {
index bba85d9..ded14a1 100644 (file)
@@ -12,6 +12,7 @@ E_API Eina_Bool                   e_policy_visibility_client_lower(E_Client *ec)
 E_API Eina_Bool                   e_policy_visibility_client_raise(E_Client *ec);
 E_API Eina_Bool                   e_policy_visibility_client_uniconify(E_Client *ec, Eina_Bool raise);
 E_API Eina_Bool                   e_policy_visibility_client_activate(E_Client *ec);
+E_API Eina_Bool                   e_policy_visibility_client_layer_lower(E_Client *ec, E_Layer layer);
 E_API E_Vis_Grab                 *e_policy_visibility_client_grab_get(E_Client *ec, const char *name);
 E_API void                        e_policy_visibility_client_grab_release(E_Vis_Grab *grab);
 E_API void                        e_policy_visibility_uniconify_render_disable_set(E_Client *ec, Eina_Bool disable);
index fafb477..73df682 100644 (file)
@@ -102,6 +102,7 @@ typedef enum
    E_VIS_JOB_TYPE_LOWER,
    E_VIS_JOB_TYPE_ACTIVATE,
    E_VIS_JOB_TYPE_UNICONIFY,
+   E_VIS_JOB_TYPE_LAYER_LOWER,
 } E_Vis_Job_Type;
 
 /* external data structure */
@@ -148,6 +149,7 @@ struct _E_Vis_Client
    } job;
    Eina_Bool prepare_emitted;
    Eina_Bool disable_uniconify_render;
+   E_Layer layer;
 };
 
 struct _E_Vis_Job_Group
index 8c6563f..5d1d651 100644 (file)
@@ -2241,8 +2241,13 @@ _e_policy_wl_aux_hint_apply(E_Client *ec)
                        // restore original layer
                        if (original_layer != evas_object_layer_get(ec->frame))
                          {
-                            evas_object_layer_set(ec->frame, original_layer);
-                            ec->layer = original_layer;
+                            Eina_Bool pend = EINA_FALSE;
+                            pend = e_policy_visibility_client_layer_lower(ec, original_layer);
+                            if (!pend)
+                              {
+                                 evas_object_layer_set(ec->frame, original_layer);
+                                 ec->layer = original_layer;
+                              }
                          }
                     }
                   ec->changable_layer[E_CHANGABLE_LAYER_TYPE_ABOVE_NOTIFICATION].set = 0;