From ce9aa23a8bc221bde4b7572007a91ff2093fca48 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sun, 13 Dec 2015 14:36:00 +1100 Subject: [PATCH] Refresh child panes in 'z' order This will make future patches which create a global z-order possible. Signed-off-by: NeilBrown --- core-pane.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 */ -- 2.39.5