[hackers] [wmii] Misc fixes.

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri, 01 Jun 2007 01:09:13 -0000

changeset: 2083:c5f811a8ca43
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Apr 16 17:00:09 2007 -0400
summary: Misc fixes.

diff -r f8cc207478c3 -r c5f811a8ca43 cmd/wmii/client.c
--- a/cmd/wmii/client.c Mon Apr 16 14:51:24 2007 -0400
+++ b/cmd/wmii/client.c Mon Apr 16 17:00:09 2007 -0400
@@ -494,13 +494,14 @@ apply_sizehints(Client *c, Rectangle *r,
         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;
diff -r f8cc207478c3 -r c5f811a8ca43 cmd/wmii/column.c
--- a/cmd/wmii/column.c Mon Apr 16 14:51:24 2007 -0400
+++ b/cmd/wmii/column.c Mon Apr 16 17:00:09 2007 -0400
@@ -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;
diff -r f8cc207478c3 -r c5f811a8ca43 cmd/wmii/frame.c
--- a/cmd/wmii/frame.c Mon Apr 16 14:51:24 2007 -0400
+++ b/cmd/wmii/frame.c Mon Apr 16 17:00:09 2007 -0400
@@ -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;
 }
diff -r f8cc207478c3 -r c5f811a8ca43 cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Mon Apr 16 14:51:24 2007 -0400
+++ b/cmd/wmii/mouse.c Mon Apr 16 17:00:09 2007 -0400
@@ -183,7 +183,7 @@ find_droppoint(Frame *frame, int x, int
         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
                 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);
diff -r f8cc207478c3 -r c5f811a8ca43 cmd/wmii/view.c
--- a/cmd/wmii/view.c Mon Apr 16 14:51:24 2007 -0400
+++ b/cmd/wmii/view.c Mon Apr 16 17:00:09 2007 -0400
@@ -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 *
Received on Fri Jun 01 2007 - 03:09:12 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:54 UTC