static void restack_handler(WTimer *tmr, Obj *obj) { if(obj!=NULL){ WTiling *ws=(WTiling*)obj; split_restack(ws->split_tree, ws->dummywin, Above); } }
static void stack_restack_split(WSplit *split, Window *other, int *mode) { Window b=None, t=None; if(split!=NULL){ split_restack(split, *other, *mode); split_stacking(split, &b, &t); if(t!=None){ *other=t; *mode=Above; } } }
bool tiling_managed_prepare_focus(WTiling *ws, WRegion *reg, int flags, WPrepareFocusResult *res) { WSplitRegion *node; if(!region_prepare_focus((WRegion*)ws, flags, res)) return FALSE; node=get_node_check(ws, reg); if(node!=NULL && node->split.parent!=NULL) splitinner_mark_current(node->split.parent, &(node->split)); /* WSplitSplit uses activity based stacking as required on WAutoWS, * so we must restack here. */ if(ws->split_tree!=NULL){ int rd=mod_tiling_raise_delay; bool use_timer=rd>0 && flags®ION_GOTO_ENTERWINDOW; if(use_timer){ if(restack_timer!=NULL){ Obj *obj=restack_timer->objwatch.obj; if(obj!=(Obj*)ws){ timer_reset(restack_timer); restack_handler(restack_timer, obj); } }else{ restack_timer=create_timer(); } } if(use_timer && restack_timer!=NULL){ timer_set(restack_timer, rd, restack_handler, (Obj*)ws); }else{ split_restack(ws->split_tree, ws->dummywin, Above); } } res->reg=reg; res->flags=flags; return TRUE; }
void tiling_manage_stdisp(WTiling *ws, WRegion *stdisp, const WMPlexSTDispInfo *di) { bool mcf=region_may_control_focus((WRegion*)ws); int flags=REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_Y; int orientation=region_orientation(stdisp); bool act=FALSE; WRectangle dg, *stdg; if(orientation!=REGION_ORIENTATION_VERTICAL /*&& orientation!=REGION_ORIENTATION_HORIZONTAL*/){ orientation=REGION_ORIENTATION_HORIZONTAL; } if(ws->stdispnode==NULL || ws->stdispnode->regnode.reg!=stdisp) region_detach_manager(stdisp); /* Remove old stdisp if corner and orientation don't match. */ if(ws->stdispnode!=NULL && (di->pos!=ws->stdispnode->corner || orientation!=ws->stdispnode->orientation)){ tiling_unmanage_stdisp(ws, TRUE, TRUE); } if(ws->stdispnode==NULL){ tiling_create_stdispnode(ws, stdisp, di->pos, orientation, di->fullsize); if(ws->stdispnode==NULL) return; }else{ WRegion *od=ws->stdispnode->regnode.reg; if(od!=NULL){ act=REGION_IS_ACTIVE(od); splittree_set_node_of(od, NULL); tiling_managed_remove(ws, od); assert(ws->stdispnode->regnode.reg==NULL); } ws->stdispnode->fullsize=di->fullsize; ws->stdispnode->regnode.reg=stdisp; splittree_set_node_of(stdisp, &(ws->stdispnode->regnode)); } if(!tiling_managed_add(ws, stdisp)){ tiling_unmanage_stdisp(ws, TRUE, TRUE); return; } stdisp->flags|=REGION_SKIP_FOCUS; dg=((WSplit*)(ws->stdispnode))->geom; dg.h=stdisp_recommended_h(ws->stdispnode); dg.w=stdisp_recommended_w(ws->stdispnode); splittree_rqgeom((WSplit*)(ws->stdispnode), flags, &dg, FALSE); stdg=&(((WSplit*)ws->stdispnode)->geom); if(stdisp->geom.x!=stdg->x || stdisp->geom.y!=stdg->y || stdisp->geom.w!=stdg->w || stdisp->geom.h!=stdg->h){ region_fit(stdisp, stdg, REGION_FIT_EXACT); } /* Restack to ensure the split tree is stacked in the expected order. */ if(ws->split_tree!=NULL) split_restack(ws->split_tree, ws->dummywin, Above); if(mcf && act) region_set_focus(stdisp); }
void tiling_restack(WTiling *ws, Window other, int mode) { xwindow_restack(ws->dummywin, other, mode); if(ws->split_tree!=NULL) split_restack(ws->split_tree, ws->dummywin, Above); }