|
|
@ -2211,6 +2211,9 @@ int ncplane_resize_realign(ncplane* n){
|
|
|
|
// The standard plane cannot be reparented; we return NULL in that case.
|
|
|
|
// The standard plane cannot be reparented; we return NULL in that case.
|
|
|
|
// If provided |newparent|==|n|, we are moving |n| to its own stack. If |n|
|
|
|
|
// If provided |newparent|==|n|, we are moving |n| to its own stack. If |n|
|
|
|
|
// is already bound to |newparent|, this is a no-op, and we return |n|.
|
|
|
|
// is already bound to |newparent|, this is a no-op, and we return |n|.
|
|
|
|
|
|
|
|
// This is essentially a wrapper around ncplane_reparent_family() that first
|
|
|
|
|
|
|
|
// reparents any children to the parent of 'n', or makes them root planes if
|
|
|
|
|
|
|
|
// 'n' is a root plane.
|
|
|
|
ncplane* ncplane_reparent(ncplane* n, ncplane* newparent){
|
|
|
|
ncplane* ncplane_reparent(ncplane* n, ncplane* newparent){
|
|
|
|
if(n == ncplane_notcurses(n)->stdplane){
|
|
|
|
if(n == ncplane_notcurses(n)->stdplane){
|
|
|
|
return NULL; // can't reparent standard plane
|
|
|
|
return NULL; // can't reparent standard plane
|
|
|
@ -2219,23 +2222,22 @@ ncplane* ncplane_reparent(ncplane* n, ncplane* newparent){
|
|
|
|
return n;
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(n->blist){
|
|
|
|
if(n->blist){
|
|
|
|
// FIXME these both look to throw away siblings following n->blist :/
|
|
|
|
|
|
|
|
if(n->boundto == n){ // children become new root planes
|
|
|
|
if(n->boundto == n){ // children become new root planes
|
|
|
|
for(ncplane* child = n->blist ; child ; child = child->bnext){
|
|
|
|
for(ncplane* child = n->blist ; child ; child = child->bnext){
|
|
|
|
child->boundto = child;
|
|
|
|
child->boundto = child;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* FIXME FIXME FIXME
|
|
|
|
if( (n->blist->bnext = ncplane_pile(n)->roots) ){
|
|
|
|
n->blist->bnext = ncplane_pile(n)->root;
|
|
|
|
n->blist->bnext->bprev = &n->blist->bnext;
|
|
|
|
n->blist->bnext->bprev = &n->blist->bnext;
|
|
|
|
}
|
|
|
|
n->blist->bprev = &ncplane_pile(n)->root;
|
|
|
|
n->blist->bprev = &ncplane_pile(n)->roots;
|
|
|
|
ncplane_pile(n)->root = n->blist;
|
|
|
|
ncplane_pile(n)->roots = n->blist;
|
|
|
|
*/
|
|
|
|
|
|
|
|
}else{ // children are rebound to current parent
|
|
|
|
}else{ // children are rebound to current parent
|
|
|
|
if( (n->blist->bnext = n->boundto->blist) ){
|
|
|
|
ncplane** plink = &n->boundto->blist;
|
|
|
|
n->boundto->blist->bprev = &n->blist->bnext;
|
|
|
|
while(*plink){
|
|
|
|
|
|
|
|
plink = &(*plink)->bnext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
n->blist->bprev = &n->boundto->blist;
|
|
|
|
n->blist->bprev = plink;
|
|
|
|
n->boundto->blist = n->blist;
|
|
|
|
*plink = n->blist;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
n->blist = NULL;
|
|
|
|
n->blist = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|