e_comp_object: consider topmost's layer_pending when changing stack 55/146655/2
authorBoram Park <boram1288.park@samsung.com>
Wed, 30 Aug 2017 02:56:51 +0000 (11:56 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 4 Sep 2017 05:30:20 +0000 (05:30 +0000)
Change-Id: I2877cc9d31384e479e5d98b4f3ef80ce4341e935

src/bin/e_comp_object.c
src/bin/e_comp_wl.c
src/bin/e_comp_wl.h

index 65842d1469152f319d5cdac73f7454aa321c826c..42161d75f31a33fb32a8293195f0936b902021f1 100644 (file)
@@ -1632,6 +1632,18 @@ _e_comp_intercept_layer_set(void *data, Evas_Object *obj, int layer)
 
 typedef void (*E_Comp_Object_Stack_Func)(Evas_Object *obj, Evas_Object *stack);
 
+static Eina_Bool
+_e_comp_object_is_pending(E_Client *ec)
+{
+   E_Client *topmost;
+
+   if (!ec) return EINA_FALSE;
+
+   topmost = e_comp_wl_topmost_parent_get(ec);
+
+   return (topmost) ? topmost->layer_pending : EINA_FALSE;
+}
+
 static void
 _e_comp_intercept_stack_helper(E_Comp_Object *cw, Evas_Object *stack, E_Comp_Object_Stack_Func stack_cb)
 {
@@ -1641,9 +1653,10 @@ _e_comp_intercept_stack_helper(E_Comp_Object *cw, Evas_Object *stack, E_Comp_Obj
    Evas_Object *o = stack;
    Eina_Bool raising = stack_cb == evas_object_stack_above;
 
-   if ((cw->ec->layer_block) || (cw->ec->layer_pending))
+   /* We should consider topmost's layer_pending for subsurface */
+   if ((cw->ec->layer_block) || _e_comp_object_is_pending(cw->ec))
      {
-        if (cw->ec->layer_pending)
+        if (_e_comp_object_is_pending(cw->ec))
           e_comp_object_layer_update(cw->smart_obj,
                                      raising? stack : NULL,
                                      raising? NULL : stack);
@@ -1662,7 +1675,7 @@ _e_comp_intercept_stack_helper(E_Comp_Object *cw, Evas_Object *stack, E_Comp_Obj
    /* assume someone knew what they were doing during client init */
    if (cw->ec->new_client)
      layer = cw->ec->layer;
-   else if ((cw2) && (cw2->ec->layer_pending))
+   else if ((cw2) && _e_comp_object_is_pending(cw2->ec))
      layer = cw2->ec->layer;
    else
      layer = evas_object_layer_get(stack);
@@ -1731,7 +1744,7 @@ _e_comp_intercept_stack_helper(E_Comp_Object *cw, Evas_Object *stack, E_Comp_Obj
      _e_comp_object_layers_add(cw, NULL, NULL, 0);
 
    /* find new object for stacking if cw2 is on state of layer_pending */
-   if ((cw2) && (cw2->ec->layer_pending))
+   if ((cw2) && _e_comp_object_is_pending(cw2->ec))
      {
         E_Client *new_stack = NULL, *current_ec = NULL;
         current_ec = cw2->ec;
@@ -1742,7 +1755,7 @@ _e_comp_intercept_stack_helper(E_Comp_Object *cw, Evas_Object *stack, E_Comp_Obj
                   current_ec = new_stack;
                   if (new_stack == cw->ec) continue;
                   if (new_stack->layer != cw2->ec->layer) break;
-                  if (!new_stack->layer_pending) break;
+                  if (!_e_comp_object_is_pending(new_stack)) break;
                }
              if ((new_stack) && (new_stack->layer == cw2->ec->layer))
                stack = new_stack->frame;
@@ -1761,7 +1774,7 @@ _e_comp_intercept_stack_helper(E_Comp_Object *cw, Evas_Object *stack, E_Comp_Obj
                   current_ec = new_stack;
                   if (new_stack == cw->ec) continue;
                   if (new_stack->layer != cw2->ec->layer) break;
-                  if (!new_stack->layer_pending) break;
+                  if (!_e_comp_object_is_pending(new_stack)) break;
                }
              if ((new_stack) && (new_stack->layer == cw2->ec->layer))
                stack = new_stack->frame;
index 527ae5ac236781fe0a95d9ee08c876677b2635b6..4c423d2399b90509ad0be4645b6dbf4686c0cf39 100644 (file)
@@ -260,8 +260,8 @@ e_comp_wl_map_size_cal_from_viewport(E_Client *ec)
    ec->comp_data->height_from_viewport = height;
 }
 
-static E_Client*
-_e_comp_wl_topmost_parent_get(E_Client *ec)
+EINTERN E_Client*
+e_comp_wl_topmost_parent_get(E_Client *ec)
 {
    E_Client *parent = NULL;
 
@@ -472,7 +472,7 @@ _e_comp_wl_evas_cb_show(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EIN
    EINA_LIST_FOREACH(ec->e.state.video_child, l, tmp)
      evas_object_show(tmp->frame);
 
-   topmost = _e_comp_wl_topmost_parent_get(ec);
+   topmost = e_comp_wl_topmost_parent_get(ec);
    if (topmost == ec && (ec->comp_data->sub.list || ec->comp_data->sub.below_list))
      _e_comp_wl_subsurface_show(ec);
 
@@ -501,7 +501,7 @@ _e_comp_wl_evas_cb_hide(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EIN
    EINA_LIST_FOREACH(ec->e.state.video_child, l, tmp)
      evas_object_hide(tmp->frame);
 
-   topmost = _e_comp_wl_topmost_parent_get(ec);
+   topmost = e_comp_wl_topmost_parent_get(ec);
    if (topmost == ec && (ec->comp_data->sub.list || ec->comp_data->sub.below_list))
      _e_comp_wl_subsurface_hide(ec);
 
@@ -1593,7 +1593,7 @@ e_comp_wl_subsurface_stack_update(E_Client *ec)
         return;
      }
 
-   topmost = _e_comp_wl_topmost_parent_get(ec);
+   topmost = e_comp_wl_topmost_parent_get(ec);
 
    _e_comp_wl_subsurface_restack(topmost);
    _e_comp_wl_subsurface_restack_bg_rectangle(topmost);
@@ -2269,7 +2269,7 @@ _e_comp_wl_subsurface_can_show(E_Client *ec)
      return EINA_FALSE;
 
    invisible_parent = _e_comp_wl_subsurface_invisible_parent_get(ec);
-   topmost = _e_comp_wl_topmost_parent_get(ec);
+   topmost = e_comp_wl_topmost_parent_get(ec);
 
    /* if topmost is composited by compositor && if there is a invisible parent */
    if (topmost->redirected && invisible_parent)
@@ -3468,7 +3468,7 @@ _e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec)
    if (ec->comp_data->sub.below_obj) return;
    if (ec->comp_data->sub.data)
      {
-         E_Client *topmost = _e_comp_wl_topmost_parent_get(ec);
+         E_Client *topmost = e_comp_wl_topmost_parent_get(ec);
          if (!topmost || e_object_is_del(E_OBJECT(topmost)) || !topmost->comp_data) return;
          if (topmost->comp_data->sub.data) return;
          if (topmost->comp_data->sub.below_obj) return;
@@ -3615,7 +3615,7 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
 
    if (_e_comp_wl_surface_subsurface_order_commit(ec))
      {
-        E_Client *topmost = _e_comp_wl_topmost_parent_get(ec);
+        E_Client *topmost = e_comp_wl_topmost_parent_get(ec);
         _e_comp_wl_subsurface_restack(topmost);
         _e_comp_wl_subsurface_restack_bg_rectangle(topmost);
      }
@@ -4928,7 +4928,7 @@ e_comp_wl_surface_commit(E_Client *ec)
 
    if (_e_comp_wl_surface_subsurface_order_commit(ec))
      {
-        E_Client *topmost = _e_comp_wl_topmost_parent_get(ec);
+        E_Client *topmost = e_comp_wl_topmost_parent_get(ec);
         _e_comp_wl_subsurface_restack(topmost);
         _e_comp_wl_subsurface_restack_bg_rectangle(topmost);
      }
index bbc9366faa92d1e40caf682fbe8d30e22a74e2b7..689e3fb83dc78cceed40ee0c55ac75b3db83837d 100644 (file)
@@ -553,6 +553,7 @@ E_API void e_comp_wl_shell_surface_ready(E_Client *ec);
 
 EINTERN Eina_Bool e_comp_wl_video_subsurface_has(E_Client *ec);
 EINTERN Eina_Bool e_comp_wl_normal_subsurface_has(E_Client *ec);
+EINTERN E_Client* e_comp_wl_topmost_parent_get(E_Client *ec);
 
 E_API enum wl_output_transform e_comp_wl_output_buffer_transform_get(E_Client *ec);
 E_API void e_comp_wl_map_size_cal_from_buffer(E_Client *ec);