From: Boram Park Date: Wed, 30 Aug 2017 02:56:51 +0000 (+0900) Subject: e_comp_object: consider topmost's layer_pending when changing stack X-Git-Tag: submit/tizen/20170905.121728~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=406ed238a72ed1ce6b33d916b169204ee9f1260a;p=platform%2Fupstream%2Fenlightenment.git e_comp_object: consider topmost's layer_pending when changing stack Change-Id: I2877cc9d31384e479e5d98b4f3ef80ce4341e935 --- diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 65842d1469..42161d75f3 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -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; diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 527ae5ac23..4c423d2399 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -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); } diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index bbc9366faa..689e3fb83d 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -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);