]> git.decadent.org.uk Git - ion3.git/blobdiff - mod_tiling/tiling.c
[svn-upgrade] Integrating new upstream version, ion3 (20070608)
[ion3.git] / mod_tiling / tiling.c
index 6fec3723b095675a06c429a934a2ce056375f7a6..877a8a861a9d11c1c03f328a0d1c82c2dcd0e8c5 100644 (file)
@@ -660,6 +660,7 @@ void tiling_do_managed_remove(WTiling *ws, WRegion *reg)
     }
 
     region_unset_manager(reg, (WRegion*)ws);
+    splittree_set_node_of(reg, NULL);
 }
 
 
@@ -701,6 +702,7 @@ void tiling_managed_remove(WTiling *ws, WRegion *reg)
             
             if(other!=NULL){
                 node->reg=other;
+                splittree_set_node_of(other, node);
                 tiling_managed_add(ws, other);
                 reused=TRUE;
             }else{
@@ -1067,45 +1069,26 @@ WFrame *tiling_split_at(WTiling *ws, WFrame *frame, const char *dirstr,
 }
 
 
-void do_unsplit(WRegion *reg)
+/*EXTL_DOC
+ * Try to relocate regions managed by \var{reg} to another frame
+ * and, if possible, destroy it.
+ */
+EXTL_EXPORT_MEMBER
+void tiling_unsplit_at(WTiling *ws, WRegion *reg)
 {
-    WTiling *ws=REGION_MANAGER_CHK(reg, WTiling);
     WPHolder *ph;
-    bool res;
     
-    if(ws==NULL)
+    if(reg==NULL || REGION_MANAGER(reg)!=(WRegion*)ws)
         return;
     
     ph=region_get_rescue_pholder_for((WRegion*)ws, reg);
     
-    if(ph==NULL){
-        res=!region_rescue_needed(reg);
-    }else{
-        res=region_rescue(reg, ph);
+    if(ph!=NULL){
+        region_rescue(reg, ph);
         destroy_obj((Obj*)ph);
     }
     
-    if(!res){
-        warn(TR("Unable to unsplit: Could not move client windows "
-                "elsewhere within the tiling."));
-        return;
-    }
-    
-    destroy_obj((Obj*)reg);
-}
-
-
-/*EXTL_DOC
- * Try to relocate regions managed by \var{reg} to another frame
- * and, if possible, destroy it.
- */
-EXTL_EXPORT_MEMBER
-void tiling_unsplit_at(WTiling *ws, WRegion *reg)
-{
-    if(reg==NULL || REGION_MANAGER(reg)!=(WRegion*)ws)
-        return;
-        
-    mainloop_defer_action((Obj*)reg, (WDeferredAction*)do_unsplit);
+    region_defer_rqdispose(reg);
 }