From: NeilBrown Date: Sun, 13 Dec 2015 03:36:00 +0000 (+1100) Subject: Refresh child panes in 'z' order X-Git-Tag: lca2016~42 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=ce9aa23a8bc221bde4b7572007a91ff2093fca48;p=edlib.git Refresh child panes in 'z' order This will make future patches which create a global z-order possible. Signed-off-by: NeilBrown --- diff --git a/core-pane.c b/core-pane.c index e491c2f4..a1bf339b 100644 --- a/core-pane.c +++ b/core-pane.c @@ -105,6 +105,7 @@ static void __pane_refresh(struct cmd_info ci) int damage = ci.extra; struct pane *p = ci.home; int ret = 0; + int nextz; if (p->damaged & DAMAGED_CLOSED) return; @@ -135,9 +136,18 @@ static void __pane_refresh(struct cmd_info ci) } p->damaged = 0; ci.extra = damage; - list_for_each_entry(c, &p->children, siblings) { - ci.home = c; - __pane_refresh(ci); + nextz = 0; + while (nextz >= 0) { + int z = nextz; + nextz = -1; + list_for_each_entry(c, &p->children, siblings) { + if (c->z > z && (nextz == -1 || c->z < nextz)) + nextz = c->z; + if (c->z == z) { + ci.home = c; + __pane_refresh(ci); + } + } } if (ret == 2) { /* "Refresh" requested a post-order call */