From 5bdad4152b20005d1a8763a91b586d6b2be71274 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 11 Dec 2015 13:41:07 +1100 Subject: [PATCH] Introduce DAMAGED_CLOSED This gets set when a pane is being closed, and prevents repeated close when a child tried to close a parent. Signed-off-by: NeilBrown --- core-pane.c | 6 ++++++ core.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/core-pane.c b/core-pane.c index f7605f94..2720cb24 100644 --- a/core-pane.c +++ b/core-pane.c @@ -107,6 +107,9 @@ static void __pane_refresh(struct cmd_info *ci) struct cmd_info ci2 = *ci; int ret = 0; + if (p->damaged & DAMAGED_CLOSED) + return; + if (p->focus == NULL) p->focus = list_first_entry_or_null( &p->children, struct pane, siblings); @@ -209,6 +212,9 @@ void pane_notify(struct pane *p, char *notification, struct mark *m, struct mark void pane_close(struct pane *p) { struct pane *c; + if (p->damaged & DAMAGED_CLOSED) + return; + p->damaged |= DAMAGED_CLOSED; pane_check(p); while (!list_empty(&p->children)) { diff --git a/core.h b/core.h index 1b326030..19c5c0de 100644 --- a/core.h +++ b/core.h @@ -314,6 +314,8 @@ enum { DAMAGED_SIZE = 2, /* these three each impose the next. */ DAMAGED_CONTENT = 4, DAMAGED_CURSOR = 8, + + DAMAGED_CLOSED = 1024, }; struct pane *pane_register(struct pane *parent, int z, -- 2.39.5