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)
{
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--;
-*/
}
/////////////////////////////////////
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;
/* 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");
{
E_Comp_Object *cw = data;
Evas_Object *o;
+ Evas_Object *op;
TRACE_DS_BEGIN(COMP:INTERCEPT RAISE);
}
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);