diff options
author | Mike Blumenkrantz <m.blumenkran@samsung.com> | 2013-02-26 08:39:10 +0000 |
---|---|---|
committer | Mike Blumenkrantz <m.blumenkran@samsung.com> | 2013-02-26 08:39:10 +0000 |
commit | 1f34e88860071c26b72ec20aeb70bfbc3c01e6c5 (patch) | |
tree | 5bc97630e5964f2d29f54096da4e742c8f9b84d1 | |
parent | 2d5d042979166a91b3a4b5a6d3103172d0cc53e3 (diff) | |
download | enlightenment-1f34e88860071c26b72ec20aeb70bfbc3c01e6c5.tar.gz |
fix comp injected object stacking
previously this was done in such a way that if the "owner" stacking object of an injected object was restacked, the injected object would remain at its original stacking level since it was not tethered to anything and did not have X managing stacking. now comp will anchor injected objects to the stacking container window and adjust stacking as needed for them
fixes shelf stacking in some cases
-rw-r--r-- | src/bin/e_comp.c | 55 | ||||
-rw-r--r-- | src/bin/e_comp.h | 2 |
2 files changed, 53 insertions, 4 deletions
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 6d52c36ffc..648834353a 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -453,6 +453,12 @@ _e_comp_win_restack(E_Comp_Win *cw) cw->c->wins = eina_inlist_prepend_relative(cw->c->wins, EINA_INLIST_GET(tcw), EINA_INLIST_GET(cw)); } } + EINA_LIST_FOREACH(cw->stack_below, l, cwp) + { + e_layout_child_lower_below(cwp->shobj, cw->shobj); + cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cwp)); + cw->c->wins = eina_inlist_prepend_relative(cw->c->wins, EINA_INLIST_GET(cwp), EINA_INLIST_GET(cw)); + } } static void @@ -2203,6 +2209,35 @@ _e_comp_win_del(E_Comp_Win *cw) cw->c->animating--; } cw->animating = 0; + if (cw->cw_above) + { + cw->cw_above->stack_below = eina_list_remove(cw->cw_above->stack_below, cw); + cw->cw_above = NULL; + } + if (cw->stack_below) + { + E_Comp_Win *cw2, *cwn = NULL; + Eina_List *l; + + if (EINA_INLIST_GET(cw)->next) + cwn = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(cw)->next, E_Comp_Win); + else if (EINA_INLIST_GET(cw)->prev) + cwn = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(cw)->prev, E_Comp_Win); + + if (cwn) + { + cwn->stack_below = cw->stack_below; + cw->stack_below = NULL; + EINA_LIST_FOREACH(cwn->stack_below, l, cw2) + cw2->cw_above = cwn; + _e_comp_win_restack(cwn); + } + else + { + EINA_LIST_FREE(cw->stack_below, cw2) + cw2->cw_above = NULL; + } + } E_FREE_FUNC(cw->up, e_comp_render_update_free); DBG(" [0x%x] del", cw->win); @@ -2582,6 +2617,19 @@ _e_comp_win_raise(E_Comp_Win *cw) } static void +_e_comp_win_lower_below(E_Comp_Win *cw, E_Comp_Win *cw2) +{ + DBG(" [0x%x] below [0x%x]", cw->win, cw2->win); + cw->c->wins_invalid = 1; + cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw)); + cw->c->wins = eina_inlist_prepend_relative(cw->c->wins, EINA_INLIST_GET(cw), EINA_INLIST_GET(cw2)); + _e_comp_win_restack(cw); + _e_comp_win_render_queue(cw); + cw->pending_count++; + _e_comp_event_source_configure(cw); +} + +static void _e_comp_win_lower(E_Comp_Win *cw) { DBG(" [0x%x] low", cw->win); @@ -5004,10 +5052,9 @@ e_comp_object_inject(E_Comp *c, Evas_Object *obj, E_Object *eobj, E_Layer layer) cwn = _e_comp_win_dummy_add(c, obj, eobj, 0); - if (EINA_INLIST_GET(cw)->prev) - _e_comp_win_raise_above(cwn, (E_Comp_Win*)EINA_INLIST_GET(cw)->prev); - else - _e_comp_win_lower(cwn); + _e_comp_win_lower_below(cwn, (E_Comp_Win*)EINA_INLIST_GET(cw)); + cw->stack_below = eina_list_append(cw->stack_below, cwn); + cwn->cw_above = cw; evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _e_comp_injected_win_del_cb, cwn); evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _e_comp_injected_win_focus_in_cb, cwn); evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _e_comp_injected_win_focus_out_cb, cwn); diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h index f14495e707..83d269df2e 100644 --- a/src/bin/e_comp.h +++ b/src/bin/e_comp.h @@ -125,6 +125,8 @@ struct _E_Comp_Win Evas_Object *obj; // composite object Evas_Object *shobj; // shadow object E_Object *eobj; // internal e object + E_Comp_Win *cw_above; // comp win that should always be stacked above this one + Eina_List *stack_below; // list of objects to keep stacked below this one Eina_List *obj_mirror; // extra mirror objects Ecore_X_Image *xim; // x image - software fallback E_Comp_Render_Update *up; // update handler |