X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fgrouppholder.c;h=2d941e4166bf15d08cd8438b055ec2a5f9f1e31b;hb=3102bb90c325d9b29ac304d8f3ea0a17df564fc8;hp=39ff6fc519b34372d61f1a98c52842607a826818;hpb=d851e7d55f99040bdfb6b5e1b799b7d6adad22b2;p=ion3.git diff --git a/ioncore/grouppholder.c b/ioncore/grouppholder.c index 39ff6fc..2d941e4 100644 --- a/ioncore/grouppholder.c +++ b/ioncore/grouppholder.c @@ -72,17 +72,21 @@ void grouppholder_do_unlink(WGroupPHolder *ph) if(group!=NULL){ UNLINK_ITEM(group->phs, ph, next, prev); - }else{ + }else if(ph->prev!=NULL){ WGroupPHolder *next=ph->next; - if(ph->prev!=NULL) - ph->prev->next=next; + ph->prev->next=next; if(next==NULL){ next=get_head(ph); assert(next->prev==ph); } next->prev=ph->prev; + }else{ + /* ph should not be on a list, if prev pointer is NULL (whereas + * next alone can be NULL in our semi-doubly-linked lists). + */ + assert(ph->next==NULL); } ph->group=NULL; @@ -193,9 +197,13 @@ static WRegion *recreate_handler(WWindow *par, if(grp==NULL) return NULL; + + rp->ph->param.whatever=(fp->mode®ION_FIT_WHATEVER ? 1 : 0); rp->reg_ret=group_do_attach(grp, &rp->ph->param, rp->data); + rp->ph->param.whatever=0; + if(rp->reg_ret==NULL){ destroy_obj((Obj*)grp); return NULL; @@ -206,6 +214,9 @@ static WRegion *recreate_handler(WWindow *par, phtmp->group=grp; } + if(fp->mode®ION_FIT_WHATEVER) + REGION_GEOM(grp)=REGION_GEOM(rp->reg_ret); + return (WRegion*)grp; }