]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/region.c
Imported Upstream version 20090110
[ion3.git] / ioncore / region.c
index 10f7c28f851bfdff14bc8e888341a6c7d06d62ef..47f8f5c3d93fd09feef16123a485929a8a7fd285 100644 (file)
@@ -1,12 +1,9 @@
 /*
  * ion/ioncore/region.c
  *
- * Copyright (c) Tuomo Valkonen 1999-2007
+ * Copyright (c) Tuomo Valkonen 1999-2009
  *
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
  */
 
 #include <string.h>
@@ -27,6 +24,7 @@
 #include "activity.h"
 #include "region-iter.h"
 #include "return.h"
+#include "key.h"
 
 
 #define D2(X)
@@ -112,7 +110,9 @@ void region_deinit(WRegion *reg)
         D(warn("Region to be focused next destroyed[1]."));
         ioncore_g.focus_next=NULL;
     }
-
+    
+    assert(reg->submapstat==NULL);
+    /*region_free_submapstat(reg);*/
     region_detach_manager(reg);
     region_unset_return(reg);
     region_unset_parent(reg);
@@ -235,7 +235,7 @@ void region_managed_remove(WRegion *mgr, WRegion *reg)
 
 
 /*EXTL_DOC
- * Return the object, if any, that is considered ''currently active''
+ * Return the object, if any, that is considered ``currently active''
  * within the objects managed by \var{mplex}.
  */
 EXTL_SAFE
@@ -283,7 +283,9 @@ bool region_prepare_focus(WRegion *reg, int flags,
                           WPrepareFocusResult *res)
 {
 
-    if(!REGION_IS_ACTIVE(reg) || !REGION_IS_MAPPED(reg)){
+    if(TRUE /* !REGION_IS_ACTIVE(reg) || 
+       !REGION_IS_MAPPED(reg) ||
+       ioncore_g.focus_next!=NULL*/){
         WRegion *mgr=REGION_MANAGER(reg);
         WRegion *par=REGION_PARENT_REG(reg);
         
@@ -382,8 +384,8 @@ static void region_rqclose_default(WRegion *reg, bool relocate)
  * the client supports the \code{WM_DELETE} protocol (see also
  * \fnref{WClientWin.kill}). The region will not be destroyed when
  * this function returns. To find out if and when it is destroyed,
- * use the "deinit" notification. If \var{relocate} is not set, and
- * \var{reg} manages other regions, it will not be closed. Otherwise
+ * use the \codestr{deinit} notification. If \var{relocate} is not set, 
+ * and \var{reg} manages other regions, it will not be closed. Otherwise
  * the managed regions will be attempted to be relocated.
  */
 EXTL_EXPORT_MEMBER
@@ -494,7 +496,7 @@ bool region_dispose_(WRegion *reg, bool not_simple)
     WPHolder *ph=NULL;
     
     if(rescue){
-        if(!region_rescue(reg, NULL)){
+        if(!region_rescue(reg, NULL, 0)){
             warn(TR("Failed to rescue some client windows - not closing."));
             return FALSE;
         }
@@ -596,6 +598,9 @@ void region_unset_manager(WRegion *reg, WRegion *mgr)
     
     reg->manager=NULL;
     
+    /* Reset status, as it is set by manager */
+    reg->flags&=~REGION_SKIP_FOCUS;
+
     if(region_is_activity_r(reg))
         region_clear_mgd_activity(mgr);
     
@@ -742,7 +747,7 @@ bool region_rqorder(WRegion *reg, WRegionOrder order)
 
 /*EXTL_DOC
  * Request ordering. Currently supported values for \var{ord}
- * are 'front' and 'back'.
+ * are \codestr{front} and \codestr{back}.
  */
 EXTL_EXPORT_AS(WRegion, rqorder)
 bool region_rqorder_extl(WRegion *reg, const char *ord)