*
* 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 <string.h>
static WPHolder *groupws_do_prepare_manage(WGroupWS *ws,
const WClientWin *cwin,
const WManageParams *param,
- int redir, int geom_weak)
+ int geom_weak)
{
WGroupAttachParams ap=GROUPATTACHPARAMS_INIT;
WFramedParam fp=FRAMEDPARAM_INIT;
WPHolder *ph;
- if(redir==MANAGE_REDIR_PREFER_YES){
- WRegion *r=(ws->grp.current_managed!=NULL
- ? ws->grp.current_managed->reg
- : NULL);
- WGroupIterTmp tmp;
- WPHolder *ph=NULL;
-
- if(r!=NULL)
- ph=region_prepare_manage(r, cwin, param, MANAGE_REDIR_PREFER_YES);
-
- if(ph==NULL){
- FOR_ALL_MANAGED_BY_GROUP(&ws->grp, r, tmp){
- ph=region_prepare_manage(r, cwin, param,
- MANAGE_REDIR_PREFER_YES);
- if(ph!=NULL)
- break;
- }
- }
- }
-
- if(redir==MANAGE_REDIR_STRICT_YES)
- return NULL;
fp.inner_geom_gravity_set=TRUE;
fp.inner_geom=param->geom;
WPHolder *groupws_prepare_manage(WGroupWS *ws, const WClientWin *cwin,
const WManageParams *param,
- int redir)
+ int priority)
{
+ int cpriority=MANAGE_PRIORITY_SUB(priority, MANAGE_PRIORITY_GROUP);
+ int bpriority=MANAGE_PRIORITY_SUBX(priority, MANAGE_PRIORITY_GROUP);
WRegion *b=(ws->grp.bottom!=NULL ? ws->grp.bottom->reg : NULL);
WPHolder *ph=NULL;
bool act_b=(ws->grp.bottom==ws->grp.current_managed);
: act_b);
if(b!=NULL && use_bottom)
- ph=region_prepare_manage(b, cwin, param, redir);
+ ph=region_prepare_manage(b, cwin, param, bpriority);
+
+ if(ph==NULL){
+ /* Check current */
+ WRegion *r=(ws->grp.current_managed!=NULL
+ ? ws->grp.current_managed->reg
+ : NULL);
+
+ if(r!=NULL && r!=b)
+ ph=region_prepare_manage(r, cwin, param, cpriority);
+ }
+
+ if(ph==NULL && MANAGE_PRIORITY_OK(priority, MANAGE_PRIORITY_GROUP))
+ ph=groupws_do_prepare_manage(ws, cwin, param, weak);
- if(ph==NULL)
- ph=groupws_do_prepare_manage(ws, cwin, param, redir, weak);
-
if(ph==NULL && b!=NULL && !use_bottom)
- ph=region_prepare_manage(b, cwin, param, redir);
+ ph=region_prepare_manage(b, cwin, param, cpriority);
return ph;
}