void area_attach(Area *a, Frame *f) { f->area = a; if(a->floating) float_attach(a, f); else column_attach(a, f); view_arrange(a->view); if(btassert("4 full", a->frame && a->sel == nil)) a->sel = a->frame; }
void area_attach(Area *a, Frame *f) { f->area = a; if(a->floating) float_attach(a, f); else column_attach(a, f); view_arrange(a->view); event("AreaAttach %s %a %#C\n", a->view->name, a, f->client); if(btassert("4 full", a->frame && a->sel == nil)) a->sel = a->frame; }
Area* column_new(View *v, Area *pos, int scrn, uint w) { Area *a; assert(!pos || !pos->floating && pos->screen == scrn); a = area_create(v, pos, scrn, w); return a; #if 0 if(!a) return nil; view_arrange(v); view_update(v); #endif }
void area_detach(Frame *f) { View *v; Area *a; a = f->area; v = a->view; if(a->floating) float_detach(f); else column_detach(f); if(v->sel->sel == nil && v->floating->sel) v->sel = v->floating; view_arrange(v); }
void area_destroy(Area *a) { Area *newfocus; View *v; int idx; v = a->view; if(a->frame) die("destroying non-empty area"); if(v->revert == a) v->revert = nil; if(v->oldsel == a) v->oldsel = nil; idx = area_idx(a); if(a->prev && !a->prev->floating) newfocus = a->prev; else newfocus = a->next; /* Can only destroy the floating area when destroying a * view---after destroying all columns. */ assert(!a->floating || !v->areas[0]); if(a->prev) a->prev->next = a->next; else if(!a->floating) v->areas[a->screen] = a->next; else v->floating = nil; if(a->next) a->next->prev = a->prev; if(newfocus && v->sel == a) area_focus(newfocus); view_arrange(v); event("DestroyArea %d\n", idx); free(a); }
void area_detach(Frame *f) { View *v; Area *a; a = f->area; v = a->view; event("AreaDetach %s %a %#C\n", v->name, a, f->client); if(a->floating) float_detach(f); else column_detach(f); if(v->sel->sel == nil && v->floating->sel) if(!v->floating->sel->client->nofocus) v->sel = v->floating; view_arrange(v); }