]> git.neil.brown.name Git - edlib.git/commitdiff
Introduce DAMAGED_CLOSED
authorNeilBrown <neil@brown.name>
Fri, 11 Dec 2015 02:41:07 +0000 (13:41 +1100)
committerNeilBrown <neil@brown.name>
Fri, 11 Dec 2015 02:42:41 +0000 (13:42 +1100)
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 <neil@brown.name>
core-pane.c
core.h

index f7605f94cbd556369fa35d86478da8d970ca06a6..2720cb248cd8583c1d26bafedce002616f523668 100644 (file)
@@ -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 1b32603093b081c771dd08f11d9f8f151d3b94d9..19c5c0de231d87c2817039a023db11b990fd70fe 100644 (file)
--- 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,