commit 9f87971cc19441b401d5c999b02a9b9e230efea3
parent 40abae9c301f3ef23b69d26ef91160721895380a
Author: Kris Maglione <jg@suckless.org>
Date: Wed, 21 May 2008 18:24:45 -0400
Adjust column scaling.
Diffstat:
3 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/cmd/wmii/bar.c b/cmd/wmii/bar.c
@@ -19,15 +19,14 @@ bar_init(WMScreen *s) {
wa.override_redirect = 1;
wa.background_pixmap = ParentRelative;
- wa.event_mask =
- ExposureMask
- | ButtonPressMask
- | ButtonReleaseMask
- | FocusChangeMask;
- s->barwin = createwindow(&scr.root, s->brect, scr.depth, InputOutput, &wa,
- CWOverrideRedirect
- | CWBackPixmap
- | CWEventMask);
+ wa.event_mask = ExposureMask
+ | ButtonPressMask
+ | ButtonReleaseMask
+ | FocusChangeMask;
+ s->barwin = createwindow(&scr.root, s->brect, scr.depth, InputOutput,
+ &wa, CWOverrideRedirect
+ | CWBackPixmap
+ | CWEventMask);
s->barwin->aux = s;
xdnd_initwindow(s->barwin);
sethandler(s->barwin, &handlers);
@@ -179,7 +178,7 @@ Bar*
bar_find(Bar *bp, const char *name) {
Bar *b;
- for(b = bp; b; b = b->next)
+ for(b=bp; b; b=b->next)
if(!strcmp(b->name, name))
break;
return b;
diff --git a/cmd/wmii/column.c b/cmd/wmii/column.c
@@ -248,9 +248,8 @@ column_scale(Area *a) {
f->dy = 0;
f->r.max.y = colh;
}else {
- surplus -= uncolh;
- f->dy = Dy(f->r);
- f->r.max.y = uncolh;
+ surplus -= Dy(f->r);
+ f->dy = Dy(f->r) - uncolh;
}
}
@@ -260,7 +259,7 @@ column_scale(Area *a) {
* surplus, or no more frames will accept it.
*/
osurplus = 0;
- while(surplus > 0 && surplus != osurplus) {
+ while(surplus != osurplus) {
osurplus = surplus;
dy = 0;
for(f=a->frame; f; f=f->anext)
@@ -274,8 +273,8 @@ column_scale(Area *a) {
frame_resize(f, f->r);
f->r.max.y = Dy(f->crect) + colh + 1;
- surplus -= Dy(f->r) - i;
f->dy = Dy(f->r);
+ surplus -= f->dy - i;
if(f->dy == i)
f->dy = 0;
}
@@ -291,7 +290,7 @@ column_scale(Area *a) {
dy = Dy(f->r);
f->r.max.y += surplus;
frame_resize(f, f->r);
- f->r.max.y = Dy(f->crect) + labelh(def.font) + 1;
+ f->r.max.y = Dy(f->crect) + colh + 1;
surplus -= Dy(f->r) - dy;
}
diff --git a/cmd/wmii/message.c b/cmd/wmii/message.c
@@ -91,8 +91,8 @@ char* debugtab[] = {
};
static char* barpostab[] = {
- "bottom",
- "top",
+ [BBottom] = "bottom",
+ [BTop] = "top",
};
/* Edit ,y/^[a-zA-Z].*\n.* {\n/d
@@ -644,9 +644,9 @@ msg_grow(View *v, IxpMsg *m) {
amount.x = Dy(f->titlebar);
amount.y = Dy(f->titlebar);
- if(c->w.hints->inc.x > amount.x/2)
+ if(amount.x < c->w.hints->inc.x)
amount.x = c->w.hints->inc.x;
- if(c->w.hints->inc.y > amount.y/2)
+ if(amount.y < c->w.hints->inc.y)
amount.y = c->w.hints->inc.y;
if(!getamt(m, &amount))