X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=mod_tiling%2Ftiling.c;h=877a8a861a9d11c1c03f328a0d1c82c2dcd0e8c5;hb=a33db24c701fe232639d904f934f68818393f95e;hp=bbefef74855029cbab2a722fed77d5e87d29b6dc;hpb=768d45580fc176cedd04db0b05621cdf596751d5;p=ion3.git diff --git a/mod_tiling/tiling.c b/mod_tiling/tiling.c index bbefef7..877a8a8 100644 --- a/mod_tiling/tiling.c +++ b/mod_tiling/tiling.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 @@ -262,25 +259,6 @@ Window tiling_xwindow(const WTiling *ws) } -WPHolder *tiling_prepare_manage_transient(WTiling *ws, - const WClientWin *transient, - const WManageParams *param, - int unused) -{ - /* Transient manager searches should not cross tilings unless - * explicitly floated. - */ - if(extl_table_is_bool_set(transient->proptab, "float")){ - return region_prepare_manage_transient_default((WRegion*)ws, - transient, - param, - unused); - }else{ - return NULL; - } -} - - /*}}}*/ @@ -682,6 +660,7 @@ void tiling_do_managed_remove(WTiling *ws, WRegion *reg) } region_unset_manager(reg, (WRegion*)ws); + splittree_set_node_of(reg, NULL); } @@ -723,6 +702,7 @@ void tiling_managed_remove(WTiling *ws, WRegion *reg) if(other!=NULL){ node->reg=other; + splittree_set_node_of(other, node); tiling_managed_add(ws, other); reused=TRUE; }else{ @@ -1021,9 +1001,10 @@ static WFrame *tiling_do_split(WTiling *ws, WSplit *node, /*EXTL_DOC - * Create a new frame on \var{ws} above/below/left of/right of - * \var{node} as indicated by \var{dirstr}. If \var{dirstr} is - * prefixed with ''floating:'' a floating split is created. + * Create a new frame on \var{ws} \codestr{above}, \codestr{below} + * \codestr{left} of, or \codestr{right} of \var{node} as indicated + * by \var{dirstr}. If \var{dirstr} is prefixed with + * \codestr{floating:} a floating split is created. */ EXTL_EXPORT_MEMBER WFrame *tiling_split(WTiling *ws, WSplit *node, const char *dirstr) @@ -1049,11 +1030,12 @@ WFrame *tiling_split_top(WTiling *ws, const char *dirstr) /*EXTL_DOC * Split \var{frame} creating a new frame to direction \var{dirstr} - * (one of ''left'', ''right'', ''top'' or ''bottom'') of \var{frame}. + * (one of \codestr{left}, \codestr{right}, \codestr{top} or + * \codestr{bottom}) of \var{frame}. * If \var{attach_current} is set, the region currently displayed in * \var{frame}, if any, is moved to thenew frame. - * If \var{dirstr} is prefixed with ''floating:'' a floating split is - * created. + * If \var{dirstr} is prefixed with \codestr{floating:}, a floating + * split is created. */ EXTL_EXPORT_MEMBER WFrame *tiling_split_at(WTiling *ws, WFrame *frame, const char *dirstr, @@ -1087,45 +1069,26 @@ WFrame *tiling_split_at(WTiling *ws, WFrame *frame, const char *dirstr, } -void do_unsplit(WRegion *reg) +/*EXTL_DOC + * Try to relocate regions managed by \var{reg} to another frame + * and, if possible, destroy it. + */ +EXTL_EXPORT_MEMBER +void tiling_unsplit_at(WTiling *ws, WRegion *reg) { - WTiling *ws=REGION_MANAGER_CHK(reg, WTiling); WPHolder *ph; - bool res; - if(ws==NULL) + if(reg==NULL || REGION_MANAGER(reg)!=(WRegion*)ws) return; ph=region_get_rescue_pholder_for((WRegion*)ws, reg); - if(ph==NULL){ - res=!region_rescue_needed(reg); - }else{ - res=region_rescue(reg, ph); + if(ph!=NULL){ + region_rescue(reg, ph); destroy_obj((Obj*)ph); } - if(!res){ - warn(TR("Unable to unsplit: Could not move client windows " - "elsewhere within the tiling.")); - return; - } - - destroy_obj((Obj*)reg); -} - - -/*EXTL_DOC - * Try to relocate regions managed by \var{reg} to another frame - * and, if possible, destroy it. - */ -EXTL_EXPORT_MEMBER -void tiling_unsplit_at(WTiling *ws, WRegion *reg) -{ - if(reg==NULL || REGION_MANAGER(reg)!=(WRegion*)ws) - return; - - mainloop_defer_action((Obj*)reg, (WDeferredAction*)do_unsplit); + region_defer_rqdispose(reg); } @@ -1177,7 +1140,8 @@ WSplit *tiling_split_tree(WTiling *ws) /*EXTL_DOC * Return the most previously active region next to \var{reg} in - * direction \var{dirstr} (left/right/up/down). The region \var{reg} + * direction \var{dirstr} (\codestr{left}, \codestr{right}, \codestr{up}, + * or \codestr{down}). The region \var{reg} * must be managed by \var{ws}. If \var{any} is not set, the status display * is not considered. */ @@ -1198,8 +1162,8 @@ WRegion *tiling_nextto(WTiling *ws, WRegion *reg, const char *dirstr, /*EXTL_DOC * Return the most previously active region on \var{ws} with no * other regions next to it in direction \var{dirstr} - * (left/right/up/down). If \var{any} is not set, the status - * display is not considered. + * (\codestr{left}, \codestr{right}, \codestr{up}, or \codestr{down}). + * If \var{any} is not set, the status display is not considered. */ EXTL_SAFE EXTL_EXPORT_MEMBER @@ -1375,8 +1339,8 @@ WSplitSplit *tiling_set_floating(WTiling *ws, WSplitSplit *split, int sp) /*EXTL_DOC * Toggle floating of a split's sides at \var{split} as indicated by the - * parameter \var{how} (set/unset/toggle). A split of the appropriate is - * returned, if there was a change. + * parameter \var{how} (\codestr{set}, \codestr{unset}, or \codestr{toggle}). + * A split of the appropriate is returned, if there was a change. */ EXTL_EXPORT_AS(WTiling, set_floating) WSplitSplit *tiling_set_floating_extl(WTiling *ws, WSplitSplit *split, @@ -1390,9 +1354,10 @@ WSplitSplit *tiling_set_floating_extl(WTiling *ws, WSplitSplit *split, /*EXTL_DOC * Toggle floating of the sides of a split containin \var{reg} as indicated - * by the parameters \var{how} (set/unset/toggle) and \var{dirstr} - * (left/right/up/down/any). The new status is returned (and \code{false} - * also on error). + * by the parameters \var{how} (\codestr{set}, \codestr{unset}, or + * \codestr{toggle}) and \var{dirstr} (\codestr{left}, \codestr{right}, + * \codestr{up}, or \codestr{down}). The new status is returned + * (and \code{false} also on error). */ EXTL_EXPORT_AS(WTiling, set_floating_at) bool tiling_set_floating_at_extl(WTiling *ws, WRegion *reg, const char *how, @@ -1771,9 +1736,6 @@ static DynFunTab tiling_dynfuntab[]={ {(DynFun*)region_xwindow, (DynFun*)tiling_xwindow}, - {(DynFun*)region_prepare_manage_transient, - (DynFun*)tiling_prepare_manage_transient}, - END_DYNFUNTAB };