protect against failure to find a container layer win in comp

it may happen that a container layer window cannot be found (someone
deleted it other than e - which is possible), and e hasn't expected
this. comp will have removed the comp win entry but containers will
not know. this is either some client being stupid, or malicious, but
protect against it, complain with an ERR and march on so we don't crash.
This commit is contained in:
Carsten Haitzler 2013-04-26 16:28:27 +09:00
parent 59c4e0f81b
commit 8cf7e61744
1 changed files with 12 additions and 4 deletions

View File

@ -5388,10 +5388,18 @@ e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Laye
con = eina_list_data_get(c->man->containers);
cwn = e_comp_win_find(con->layers[0].win);
cwn->stack_below = eina_list_append(cwn->stack_below, cw);
cw->cw_above = cwn;
c->wins = eina_inlist_remove(c->wins, EINA_INLIST_GET(cw));
c->wins = eina_inlist_prepend_relative(c->wins, EINA_INLIST_GET(cw), EINA_INLIST_GET(cwn));
if (!cwn)
{
ERR("Major error. Cannot find container layer 0 window marker");
c->wins = eina_inlist_prepend(c->wins, EINA_INLIST_GET(cw));
}
else
{
cwn->stack_below = eina_list_append(cwn->stack_below, cw);
cw->cw_above = cwn;
c->wins = eina_inlist_remove(c->wins, EINA_INLIST_GET(cw));
c->wins = eina_inlist_prepend_relative(c->wins, EINA_INLIST_GET(cw), EINA_INLIST_GET(cwn));
}
}
}
if (stack == E_COMP_CANVAS_STACK_ABOVE)