static void retile_children(XConf* x) {
size_t height = x->height - Divider - 2;
-
Child_T* child = Children;
if (NChildren == 1) {
XMoveResizeWindow(x->display, child->wid, 0, Divider+2, x->width, height);
XMoveResizeWindow(x->display, child->wid, 0, Divider+2, x->width/2, height);
/* place the slave windows */
size_t slave_height = height / (NChildren - 1);
+ size_t slave_extra = height % (NChildren - 1);
size_t offset = Divider+2;
for (child = child->next; child; child = child->next, offset += slave_height) {
+ if (!child->next) slave_height += slave_extra;
XMoveResizeWindow(x->display, child->wid, x->width/2, offset, x->width/2, slave_height);
}
}
+ XSync(x->display, False);
retile = 0;
}
static void xredraw(XConf* x) {
+ /* retile the windows */
/* determine the size of the regions */
size_t maxtagrows = ((x->height/4) / x->font->height);
size_t tagrows = view_limitrows(&Tags, maxtagrows);
Divider = draw_hrule(x, &csr);
draw_rect(x, EditBg, 0, Divider+2, csr.w, csr.h);
XCopyArea(x->display, x->pixmap, x->self, x->gc, 0, 0, x->width, x->height, 0, 0);
- if ((retile || prev_div != Divider) && NChildren) {
- retile_children(x);
- }
XFlush(x->display);
+ if ((retile || prev_div != Divider) && NChildren)
+ retile_children(x);
}
static void xupdate(Job* job) {