- if(node==NULL)
- return;
-
- splittree_remove((WSplit*)node, (!ds && other!=NULL));
-
- if(!ds){
- if(other==NULL)
- region_dispose((WRegion*)ws, mcf);
- else if(act && mcf)
- region_warp(other);
+ if(node!=NULL){
+ bool reused=FALSE;
+
+ if(other==NULL && !norestore){
+ WWindow *par=REGION_PARENT(ws);
+ WFitParams fp;
+
+ assert(par!=NULL);
+
+ fp.g=node->split.geom;
+ fp.mode=REGION_FIT_EXACT;
+
+ other=(ws->create_frame_fn)(par, &fp);
+
+ if(other!=NULL){
+ node->reg=other;
+ tiling_managed_add(ws, other);
+ reused=TRUE;
+ }else{
+ warn(TR("Tiling in useless state."));
+ }
+ }
+
+ if(!reused)
+ splittree_remove((WSplit*)node, (!norestore && other!=NULL));