Misc fixes.

This commit is contained in:
Kris Maglione 2007-04-16 17:00:09 -04:00
parent 9a72e4a48b
commit b67d9d3848
5 changed files with 35 additions and 32 deletions

View File

@ -494,13 +494,14 @@ apply_sizehints(Client *c, Rectangle *r, Bool floating, Bool frame, Align sticky
XSizeHints *s;
Rectangle r2;
uint bw, bh;
bw = 0;
bh = 0;
s = &c->size;
r2 = rectsubpt(*r, r->min);
if(frame)
r2 = frame2client(c->sel, r2);
bw = 0;
bh = 0;
if(s->flags & PMinSize) {
bw = s->min_width;

View File

@ -193,7 +193,7 @@ scale_column(Area *a) {
minh = labelh(def.font);
colh = labelh(def.font);
uncolh = minh + frame_delta_h();
uncolh = minh + colh +1;
ncol = 0;
nuncol = 0;
@ -234,10 +234,10 @@ scale_column(Area *a) {
if(j < 0 && f != a->sel)
f->collapsed = True;
else {
if(Dx(f->crect) <= minh)
f->crect.max.x = 1;
if(Dy(f->crect) <= minh)
f->crect.max.y = 1;
else
f->crect.max.x = minh;
f->crect.max.y -= minh;
dy += Dy(f->crect);
}
j--;
@ -259,24 +259,24 @@ scale_column(Area *a) {
}
i = nuncol;
for(f=a->frame; f; f=f->anext) {
f->rect.max.x = Dx(a->rect);
if(!f->collapsed) {
i--;
if(i)
f->rect.max.y = (float)Dy(f->crect) / dy * surplus;
else
f->rect.max.y = surplus;
f->rect.max.y += minh + frame_delta_h();
apply_sizehints(f->client, &f->rect, False, True, NWEST);
dy -= Dy(f->crect);
resize_frame(f, f->rect);
surplus -= Dy(f->rect) - frame_delta_h() - minh;
}else
f->rect.max.y = labelh(def.font);
}
for(f=a->frame; f; f=f->anext) {
f->rect.max.x = Dx(a->rect);
if(f->collapsed)
f->rect.max.y = labelh(def.font);
else {
if(--i != 0)
f->rect.max.y = (float)Dy(f->crect) / dy * surplus;
else
f->rect.max.y = surplus;
f->rect.max.y += uncolh;
apply_sizehints(f->client, &f->rect, False, True, NWEST);
dy -= Dy(f->rect) - uncolh;
surplus -= Dy(f->rect) - uncolh;
resize_frame(f, f->rect);
}
}
yoff = a->rect.min.y;
i = nuncol;

View File

@ -83,7 +83,7 @@ frame2client(Frame *f, Rectangle r) {
r.max.y -= frame_delta_h();
}else {
r.max.x -= 2;
r.max.y -= labelh(def.font) - 1;
r.max.y -= labelh(def.font) + 1;
}
r.max.x = max(r.min.x+1, r.max.x);
r.max.y = max(r.min.y+1, r.max.y);
@ -96,8 +96,8 @@ client2frame(Frame *f, Rectangle r) {
r.max.x += def.border * 2;
r.max.y += frame_delta_h();
}else {
r.max.y += 2;
r.max.x +=labelh(def.font) + 1;
r.max.x += 2;
r.max.y += labelh(def.font) + 1;
}
return r;
}

View File

@ -183,7 +183,7 @@ find_droppoint(Frame *frame, int x, int y, Rectangle *r, Bool do_move) {
r->min.y = screen->rect.min.y;
r->max.y = screen->brect.min.y;
if(x < (a->rect.min.x + labelh(def.font))) {
r->min.x = a->rect.min.x + Delta;
r->min.x = a->rect.min.x - Delta;
r->max.x = a->rect.min.x + Delta;
if(do_move) {
a = new_column(v, a_prev, 0);
@ -193,7 +193,7 @@ find_droppoint(Frame *frame, int x, int y, Rectangle *r, Bool do_move) {
return;
}
if(x > (a->rect.max.x - labelh(def.font))) {
r->min.x = a->rect.max.x + Delta;
r->min.x = a->rect.max.x - Delta;
r->max.x = a->rect.max.x + Delta;
if(do_move) {
a = new_column(v, a, 0);
@ -343,7 +343,7 @@ mouse_resizecol(Divide *d) {
querypointer(&scr.root, &x, &y);
x = a->rect.min.x + minw;
x2 = x + a->next->rect.max.x - minw;
x2 = a->next->rect.max.x - minw;
cwin = createwindow(&scr.root, Rect(x, y, x2, y+1), 0, InputOnly, &wa, 0);
mapwin(cwin);

View File

@ -67,7 +67,7 @@ create_view(const char *name) {
write_event("CreateTag %s\n", v->name);
create_area(v, nil, 0);
create_area(v, v->area, 0);
new_column(v, v->area, 0);
for(i=&view; *i; i=&(*i)->next)
if(strcmp((*i)->name, name) < 0) break;
@ -296,6 +296,8 @@ arrange_view(View *v) {
xoff = a->rect.max.x;
arrange_column(a, False);
}
if(v == screen->sel)
update_divs();
}
Rectangle *