From: SooChan Lim Date: Thu, 30 Nov 2023 08:25:58 +0000 (+0900) Subject: e_comp_object: remove the unnecessary code X-Git-Tag: accepted/tizen/unified/20231205.171428~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1cac21bbcf839f28adb0b3f0f832b1dc3a3f91c;p=platform%2Fupstream%2Fenlightenment.git e_comp_object: remove the unnecessary code e_comp->layer[x].obj is the indendent evas_object generated from calling evas_object_rectangle_add(e_comp->evas) function. It is never smart object and ec->frame. However, there are so many code to compare the layer[x].obj with smart_object of e_client and with ec->frame. Those code are useless and this patch delete them. Change-Id: Iaff307802e5f2321ad1f44774a1aebd8f189185c --- diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 72b8d76dd2..4daca24962 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -5123,14 +5123,6 @@ e_client_redirected_set(E_Client *ec, Eina_Bool set) //////////////////////////////////////////// -EINTERN Eina_Bool -e_client_is_stacking(const E_Client *ec) -{ - return e_comp->layers[e_comp_canvas_layer_map(ec->layer)].obj == ec->frame; -} - -//////////////////////////////////////////// - E_API void e_client_transform_update(E_Client *ec) { diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 1b2c3022a1..325c2abad0 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -1170,7 +1170,6 @@ EINTERN E_Client *e_client_under_pointer_get(E_Desk *desk, E_Client *exclude); E_API E_Client *e_client_under_position_get(E_Desk *desk, int x, int y, E_Client *exclude); E_API E_Client *e_client_under_position_input_get(E_Desk *desk, int x, int y); E_API void e_client_redirected_set(E_Client *ec, Eina_Bool set); -EINTERN Eina_Bool e_client_is_stacking(const E_Client *ec); EINTERN E_Client *e_client_transient_child_top_get(E_Client *ec, Eina_Bool consider_focus); E_API void e_client_visibility_calculate(void); // FIXME: This has to be deprecated. E_API void e_client_visibility_skip_set(E_Client *ec, Eina_Bool skip); diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 06a0e19d90..a8c34ccdac 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -595,18 +595,8 @@ _e_comp_shaped_check(int w, int h, const Eina_Rectangle *rects, int num) static void _e_comp_object_layers_add(E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object *below, Eina_Bool prepend) { - E_Comp_Object *layer_cw = NULL; - - /* try to get the internal data for the layer; - * will return NULL for fake layers (eg. wayland) - */ g_rec_mutex_lock(&e_comp->ec_list_mutex); - if (e_comp->layers[cw->layer].obj) - { - if (evas_object_smart_smart_get(e_comp->layers[cw->layer].obj)) - layer_cw = evas_object_smart_data_get(e_comp->layers[cw->layer].obj); - } - if (layer_cw == cw) layer_cw = NULL; + if (above) e_comp->layers[above->layer].clients = eina_inlist_append_relative(e_comp->layers[above->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(above->ec)); else if (below) @@ -615,42 +605,26 @@ _e_comp_object_layers_add(E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object { if (prepend) e_comp->layers[cw->layer].clients = eina_inlist_prepend(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec)); - else if (layer_cw) - e_comp->layers[cw->layer].clients = eina_inlist_prepend_relative(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(layer_cw->ec)); else //this is either the layer object or a tough actin tinactin^W^W^Wfast stacking client e_comp->layers[cw->layer].clients = eina_inlist_append(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec)); } e_comp->layers[cw->layer].clients_count++; + g_rec_mutex_unlock(&e_comp->ec_list_mutex); -#ifndef E_RELEASE_BUILD - if (layer_cw) - { - E_Client *below_ec = e_client_below_get(cw->ec); - if (below_ec) - { - g_rec_mutex_lock(&e_comp->ec_list_mutex); - if (e_comp->layers[cw->layer].obj == below_ec->frame) - CRI("ACK! ec:%p", cw->ec); - g_rec_mutex_unlock(&e_comp->ec_list_mutex); - } - } -#endif } static void _e_comp_object_layers_remove(E_Comp_Object *cw) { g_rec_mutex_lock(&e_comp->ec_list_mutex); + if (cw->ec && e_comp->layers[cw->layer].clients) { e_comp->layers[cw->layer].clients = eina_inlist_remove(e_comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec)); e_comp->layers[cw->layer].clients_count--; } + g_rec_mutex_unlock(&e_comp->ec_list_mutex); -/* - e_comp->layers[cw->layer].objs = eina_inlist_remove(e_comp->layers[cw->layer].objs, EINA_INLIST_GET(cw)); - e_comp->layers[cw->layer].objs_count--; -*/ } ///////////////////////////////////// @@ -2094,8 +2068,6 @@ _e_comp_intercept_stack_helper(E_Comp_Object *cw, Evas_Object *stack, E_Comp_Obj ecstack = e_client_below_get(cw->ec); if (layer != e_comp_canvas_layer_map_to(cw->layer)) { - /* some FOOL is trying to restack a layer marker */ - if (cw->smart_obj == e_comp->layers[cw->layer].obj) return; evas_object_layer_set(cw->smart_obj, layer); /* we got our layer wrangled, return now! */ if (layer != e_comp_canvas_layer_map_to(cw->layer)) return; @@ -2269,7 +2241,6 @@ _e_comp_intercept_lower(void *data, Evas_Object *obj) /* prepend to client list since this client should be the first item now */ _e_comp_object_layers_add(cw, NULL, NULL, 1); if (evas_object_layer_get(o) != evas_object_layer_get(obj)) goto end; //already at bottom! - if (obj == e_comp->layers[cw->layer].obj) goto end; //never lower a layer marker! evas_object_data_set(obj, "client_restack", (void*)1); _e_comp_object_lower(cw, obj); evas_object_data_del(obj, "client_restack"); @@ -2286,6 +2257,7 @@ _e_comp_intercept_raise(void *data, Evas_Object *obj) { E_Comp_Object *cw = data; Evas_Object *o; + Evas_Object *op; TRACE_DS_BEGIN(COMP:INTERCEPT RAISE); @@ -2303,34 +2275,24 @@ _e_comp_intercept_raise(void *data, Evas_Object *obj) } if (!EINA_INLIST_GET(cw->ec)->next) goto end;//already highest on layer o = evas_object_above_get(obj); - { - E_Client *ecabove = e_client_above_get(cw->ec); - if (ecabove && (ecabove->frame == e_comp->layers[cw->layer].obj) && - (ecabove->frame == o)) goto end; //highest below marker - } if (evas_object_layer_get(o) != evas_object_layer_get(obj)) goto end; //already at top! - if (obj == e_comp->layers[cw->layer].obj) //never raise a non-layer marker! - _e_comp_object_raise(obj); - else - { - Evas_Object *op; - /* still stack below override below the layer marker */ - for (op = o = e_comp->layers[cw->layer].obj; - o && o != e_comp->layers[cw->layer - 1].obj; - op = o, o = evas_object_below_get(o)) + /* still stack below override below the layer marker */ + for (op = o = e_comp->layers[cw->layer].obj; + o && o != e_comp->layers[cw->layer - 1].obj; + op = o, o = evas_object_below_get(o)) + { + if (evas_object_smart_smart_get(o)) { - if (evas_object_smart_smart_get(o)) - { - E_Client *ec; + E_Client *ec; - ec = e_comp_object_client_get(o); - if (ec && (!ec->override)) break; - } + ec = e_comp_object_client_get(o); + if (ec && (!ec->override)) break; } - _e_comp_object_stack_below(obj, op); - e_client_focus_defer_set(cw->ec); } + _e_comp_object_stack_below(obj, op); + e_client_focus_defer_set(cw->ec); + if (!cw->visible) goto end; e_comp_render_queue(); _e_comp_object_transform_obj_stack_update(obj);