X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fgroup-ws.c;h=647cef05e451da3f35cbdd6e9782ae85a444dff4;hb=ae4260bb64817c11f9a7140324cd3e3ba113e297;hp=48ee838cb4a5a7dccdd00b83ae175ebf2f82847c;hpb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;p=ion3.git diff --git a/ioncore/group-ws.c b/ioncore/group-ws.c index 48ee838..647cef0 100644 --- a/ioncore/group-ws.c +++ b/ioncore/group-ws.c @@ -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 @@ -173,34 +170,12 @@ bool groupws_attach_framed_extl(WGroupWS *ws, WRegion *reg, ExtlTab t) 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; @@ -223,8 +198,10 @@ static WPHolder *groupws_do_prepare_manage(WGroupWS *ws, 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); @@ -249,13 +226,23 @@ WPHolder *groupws_prepare_manage(WGroupWS *ws, const WClientWin *cwin, : 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; }