+ if(group_bottom(ws)==reg){
+ if(group_empty_for_bottom_stdisp(ws))
+ return region_disposeroot((WRegion*)ws);
+ }
+
+ return reg;
+}
+
+
+/*}}}*/
+
+
+/*{{{ Bottom */
+
+
+void group_bottom_set(WGroup *grp)
+{
+ CALL_DYN(group_bottom_set, grp, (grp));
+}
+
+
+static void group_do_set_bottom(WGroup *grp, WStacking *st)
+{
+ WStacking *was=grp->bottom;
+ WStacking *std=grp->managed_stdisp;
+
+ grp->bottom=st;
+
+ if(!OBJ_IS_BEING_DESTROYED(grp)){
+ bool noremanage=((was==st) ||
+ (was==NULL && std==NULL) ||
+ (st!=NULL && st==std) ||
+ (st==NULL && was==std));
+
+ if(!noremanage &&
+ (st==NULL || HAS_DYN(st->reg, region_manage_stdisp))){
+ group_remanage_stdisp(grp);
+ }
+
+ group_bottom_set(grp);
+ }
+}
+
+
+/*EXTL_DOC
+ * Sets the `bottom' of \var{ws}. The region \var{reg} must already
+ * be managed by \var{ws}, unless \code{nil}.
+ */
+EXTL_EXPORT_MEMBER
+bool group_set_bottom(WGroup *ws, WRegion *reg)
+{
+ WStacking *st=NULL;
+
+ if(reg!=NULL){
+ st=group_find_stacking(ws, reg);
+
+ if(st==NULL)
+ return FALSE;
+ }
+
+ group_do_set_bottom(ws, st);
+