]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/manage.c
[svn-upgrade] Integrating new upstream version, ion3 (20070506)
[ion3.git] / ioncore / manage.c
index 2eb6f38b8f97e02bb2cfb54402cc6c417867338a..bcc8a5388a394de0b3919b747e6eba04ae160461 100644 (file)
@@ -3,10 +3,7 @@
  *
  * Copyright (c) Tuomo Valkonen 1999-2007. 
  *
- * 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 <libtu/objp.h>
@@ -74,8 +71,8 @@ static WPHolder *try_target(WClientWin *cwin, const WManageParams *param,
         
     if(r==NULL)
         return NULL;
-            
-    return region_prepare_manage(r, cwin, param, MANAGE_REDIR_PREFER_NO);
+    
+    return region_prepare_manage(r, cwin, param, MANAGE_PRIORITY_NONE);
 }
 
 
@@ -118,7 +115,7 @@ static bool handle_target_winprops(WClientWin *cwin, const WManageParams *param,
                 
                 if(ph==NULL){
                     ph=region_prepare_manage(reg, cwin, param, 
-                                             MANAGE_REDIR_PREFER_YES);
+                                             MANAGE_PRIORITY_NONE);
                     
                     if(ph==NULL)
                         destroy_obj((Obj*)reg);
@@ -159,7 +156,7 @@ static bool try_fullscreen(WClientWin *cwin, WScreen *dflt,
     
     if(fs_scr!=NULL){
         WPHolder *fs_ph=region_prepare_manage((WRegion*)fs_scr, cwin, param,
-                                              MANAGE_REDIR_STRICT_NO);
+                                              MANAGE_PRIORITY_NOREDIR);
         
         if(fs_ph!=NULL){
             int swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
@@ -208,8 +205,8 @@ bool clientwin_do_manage_default(WClientWin *cwin,
     if(ph==NULL){
         /* Find a placeholder for non-fullscreen state */
         ph=region_prepare_manage((WRegion*)scr, cwin, param,
-                                 MANAGE_REDIR_PREFER_YES);
-
+                                 MANAGE_PRIORITY_NONE);
+        
         if(try_fullscreen(cwin, scr, param)){
             if(pholder_target(ph)!=(WRegion*)region_screen_of((WRegion*)cwin)){
                 WRegion *grp=region_groupleader_of((WRegion*)cwin);
@@ -245,29 +242,25 @@ bool clientwin_do_manage_default(WClientWin *cwin,
 
 
 WPHolder *region_prepare_manage(WRegion *reg, const WClientWin *cwin,
-                                const WManageParams *param, int redir)
+                                const WManageParams *param, int priority)
 {
     WPHolder *ret=NULL;
     CALL_DYN_RET(ret, WPHolder*, region_prepare_manage, reg, 
-                 (reg, cwin, param, redir));
+                 (reg, cwin, param, priority));
     return ret;
 }
 
 
 WPHolder *region_prepare_manage_default(WRegion *reg, const WClientWin *cwin,
-                                        const WManageParams *param, int redir)
+                                        const WManageParams *param, int priority)
 {
-    WRegion *curr;
-    
-    if(redir==MANAGE_REDIR_STRICT_NO)
-        return NULL;
-    
-    curr=region_current(reg);
+    int cpriority=MANAGE_PRIORITY_SUB(priority, MANAGE_PRIORITY_NONE);
+    WRegion *curr=region_current(reg);
     
     if(curr==NULL)
         return NULL;
         
-    return region_prepare_manage(curr, cwin, param, MANAGE_REDIR_PREFER_YES);
+    return region_prepare_manage(curr, cwin, param, cpriority);
 }
 
 
@@ -298,10 +291,10 @@ WPHolder *region_prepare_manage_transient_default(WRegion *reg,
 
 
 bool region_manage_clientwin(WRegion *reg, WClientWin *cwin,
-                             const WManageParams *par, int redir)
+                             const WManageParams *par, int priority)
 {
     bool ret;
-    WPHolder *ph=region_prepare_manage(reg, cwin, par, redir);
+    WPHolder *ph=region_prepare_manage(reg, cwin, par, priority);
     int swf=(par->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
     
     if(ph==NULL)