diff --git a/cmd/wmii/column.c b/cmd/wmii/column.c index 7881e5a0..098e9642 100644 --- a/cmd/wmii/column.c +++ b/cmd/wmii/column.c @@ -72,6 +72,18 @@ column_minwidth(void) return 4 * labelh(def.font); } +static void +columns_update(View *v) { + Area *a; + Frame *f; + int s; + + foreach_frame(v, s, a, f) { + f->screen = s; + f->column = area_idx(a); + } +} + Area* column_new(View *v, Area *pos, int scrn, uint w) { Area *a; @@ -84,6 +96,7 @@ column_new(View *v, Area *pos, int scrn, uint w) { return nil; view_arrange(v); + columns_update(v); view_update(v); #endif } @@ -101,6 +114,15 @@ column_insert(Area *a, Frame *f, Frame *pos) { area_setsel(a, f); } +void +column_destroy(Area *a) { + View *v; + + v = a->view; + area_destroy(a); + columns_update(v); +} + void column_attach(Area *a, Frame *f) { Frame *first; @@ -135,7 +157,7 @@ column_detach(Frame *f) { stack_scale(first, dy); column_arrange(a, false); }else if(a->view->areas[a->screen]->next) - area_destroy(a); + column_destroy(a); } static void column_scale(Area*); diff --git a/cmd/wmii/fns.h b/cmd/wmii/fns.h index 0737e1b7..cc2e7e05 100644 --- a/cmd/wmii/fns.h +++ b/cmd/wmii/fns.h @@ -113,6 +113,7 @@ char* column_getmode(Area*); void column_arrange(Area*, bool dirty); void column_attach(Area*, Frame*); void column_attachrect(Area*, Frame*, Rectangle); +void column_destroy(Area*); void column_detach(Frame*); void column_frob(Area*); void column_insert(Area*, Frame*, Frame*);