X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fgroup-ws.c;h=48ee838cb4a5a7dccdd00b83ae175ebf2f82847c;hp=b50402cfd1b94992d812d0499906859c1d0a3655;hb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;hpb=8366314611bf30a0f31d25bf5f5023186fa87692 diff --git a/ioncore/group-ws.c b/ioncore/group-ws.c index b50402c..48ee838 100644 --- a/ioncore/group-ws.c +++ b/ioncore/group-ws.c @@ -1,7 +1,7 @@ /* * ion/ioncore/group-ws.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * 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 @@ -29,28 +29,12 @@ #include "framedpholder.h" #include "float-placement.h" #include "resize.h" +#include "conf.h" /*{{{ Settings */ -static bool default_ws_params_set=FALSE; -static ExtlTab default_ws_params; - - -/*EXTL_DOC - * Set module basic settings. Currently only the \code{placement_method} - * parameter is supported. - * - * The method can be one of ''udlr'', ''lrud'' (default) and ''random''. - * The ''udlr'' method looks for free space starting from top the top left - * corner of the workspace moving first down keeping the x coordinate fixed. - * If it find no free space, it start looking similarly at next x coordinate - * unoccupied by other objects and so on. ''lrud' is the same but with the - * role of coordinates changed and both fall back to ''random'' placement - * if no free area was found. - */ - void ioncore_groupws_set(ExtlTab tab) { char *method=NULL; @@ -67,13 +51,6 @@ void ioncore_groupws_set(ExtlTab tab) warn(TR("Unknown placement method \"%s\"."), method); free(method); } - - if(extl_table_gets_t(tab, "default_ws_params", &t)){ - if(default_ws_params_set) - extl_unref_table(default_ws_params); - default_ws_params=t; - default_ws_params_set=TRUE; - } } @@ -85,9 +62,6 @@ void ioncore_groupws_get(ExtlTab t) : (ioncore_placement_method==PLACEMENT_LRUD ? "lrud" : "random"))); - - if(default_ws_params_set) - extl_table_sets_t(t, "default_ws_params", default_ws_params); } @@ -196,28 +170,6 @@ bool groupws_attach_framed_extl(WGroupWS *ws, WRegion *reg, ExtlTab t) /*{{{ groupws_prepare_manage */ -#define REG_OK(R) OBJ_IS(R, WMPlex) - - -static WMPlex *find_existing(WGroupWS *ws) -{ - WGroupIterTmp tmp; - WRegion *r=(ws->grp.current_managed!=NULL - ? ws->grp.current_managed->reg - : NULL); - - if(r!=NULL && REG_OK(r)) - return (WMPlex*)r; - - FOR_ALL_MANAGED_BY_GROUP(&ws->grp, r, tmp){ - if(REG_OK(r)) - return (WMPlex*)r; - } - - return NULL; -} - - static WPHolder *groupws_do_prepare_manage(WGroupWS *ws, const WClientWin *cwin, const WManageParams *param, @@ -228,13 +180,22 @@ static WPHolder *groupws_do_prepare_manage(WGroupWS *ws, WPHolder *ph; if(redir==MANAGE_REDIR_PREFER_YES){ - WMPlex *m=find_existing(ws); - if(m!=NULL){ - WPHolder *ph; - ph=region_prepare_manage((WRegion*)m, cwin, param, - MANAGE_REDIR_STRICT_YES); - if(ph!=NULL) - return ph; + 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; + } } } @@ -267,7 +228,7 @@ WPHolder *groupws_prepare_manage(WGroupWS *ws, const WClientWin *cwin, WRegion *b=(ws->grp.bottom!=NULL ? ws->grp.bottom->reg : NULL); WPHolder *ph=NULL; bool act_b=(ws->grp.bottom==ws->grp.current_managed); - bool always_float, use_bottom; + bool use_bottom; int weak=0; if(param->maprq && ioncore_g.opmode!=IONCORE_OPMODE_INIT @@ -315,7 +276,7 @@ WPHolder *groupws_prepare_manage_transient(WGroupWS *ws, const WClientWin *cwin, fp.inner_geom_gravity_set=TRUE; fp.inner_geom=param->geom; fp.gravity=param->gravity; - fp.mkframe=create_transient_frame; + fp.mode=FRAME_MODE_TRANSIENT; ap.geom_weak_set=1; ap.geom_weak=0; @@ -379,7 +340,7 @@ void groupws_deinit(WGroupWS *ws) WRegion *groupws_load(WWindow *par, const WFitParams *fp, - ExtlTab tab) + ExtlTab tab) { WGroupWS *ws; @@ -394,14 +355,6 @@ WRegion *groupws_load(WWindow *par, const WFitParams *fp, } -WRegion *groupws_load_default(WWindow *par, const WFitParams *fp) -{ - return groupws_load(par, fp, (default_ws_params_set - ? default_ws_params - : extl_table_none())); -} - - static DynFunTab groupws_dynfuntab[]={ {(DynFun*)region_prepare_manage, (DynFun*)groupws_prepare_manage},