]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/grouppholder.c
Merge commit '20081002' into HEAD
[ion3.git] / ioncore / grouppholder.c
index 39ff6fc519b34372d61f1a98c52842607a826818..2d941e4166bf15d08cd8438b055ec2a5f9f1e31b 100644 (file)
@@ -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&REGION_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&REGION_FIT_WHATEVER)
+        REGION_GEOM(grp)=REGION_GEOM(rp->reg_ret);
+    
     return (WRegion*)grp;
 }