X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fdetach.c;h=2d24fee42c70d7fc31db0200e30a6e01c5cbb717;hb=de01e0dd832dc5eeac12f504d02b362c52bb4557;hp=72c74060e4d6d1278b4866147c5b7e2b36e55fa3;hpb=24c77c99349b1ebb879c674e3c33a90c125983a5;p=ion3.git diff --git a/ioncore/detach.c b/ioncore/detach.c index 72c7406..2d24fee 100644 --- a/ioncore/detach.c +++ b/ioncore/detach.c @@ -145,7 +145,6 @@ static WGroup *find_group(WRegion *reg, uint *level) bool ioncore_detach(WRegion *reg, int sp) { - WPHolder *ph=region_get_return(reg); WFrameMode mode; WGroup *grp; bool set, nset; @@ -183,15 +182,17 @@ bool ioncore_detach(WRegion *reg, int sp) /*EXTL_DOC - * Detach or reattach \var{reg}, depending on whether \var{how} - * is \codestr{set}, \codestr{unset} or \codestr{toggle}. (Detaching - * means making \var{reg} managed by its nearest ancestor \type{WGroup}, - * framed if \var{reg} is not itself \type{WFrame}. Reattaching means - * making it managed where it used to be managed, if a return-placeholder - * exists.) - * If \var{reg} is the `bottom' of some group, the whole group is - * detached. If \var{reg} is a \type{WWindow}, it is put into a - * frame. + * Detach or reattach \var{reg} or any group it is the leader of + * (see \fnref{WRegion.groupleader_of}), depending on whether \var{how} + * is \codestr{set}, \codestr{unset} or \codestr{toggle}. If this + * region is not a window, it is put into a frame. + * + * Detaching a region means having it managed by its nearest ancestor + * \type{WGroup}. Reattaching means having it managed where it used + * to be managed, if a ``return placeholder'' exists. + * + * Additionally, setting \var{how} to \codestr{forget}, can be used to + * clear this return placeholder of the group leader of \var{reg}. */ EXTL_EXPORT_AS(ioncore, detach) bool ioncore_detach_extl(WRegion *reg, const char *how) @@ -199,6 +200,11 @@ bool ioncore_detach_extl(WRegion *reg, const char *how) if(how==NULL) how="set"; + if(strcmp(how, "forget")==0){ + region_unset_return(region_groupleader_of(reg)); + return FALSE; + } + return ioncore_detach(reg, libtu_string_to_setparam(how)); }