[hackers] [wmii] Fix crash. Fix botched gravity handling. Fix fullscreen.

From: Kris Maglione <jg_AT_suckless.org>
Date: Wed Jun 27 01:42:40 2007

changeset: 2167:348ce251ee3f
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Jun 26 19:41:59 2007 -0400
summary: Fix crash. Fix botched gravity handling. Fix fullscreen.

diff -r 896a3ea2651d -r 348ce251ee3f cmd/wmii/client.c
--- a/cmd/wmii/client.c Tue Jun 26 17:01:47 2007 -0400
+++ b/cmd/wmii/client.c Tue Jun 26 19:41:59 2007 -0400
@@ -220,18 +220,17 @@ gravclient(Client *c, Rectangle rd) {
                         r = c->sel->r;
                 else
                         r = c->sel->revert;
- r = gravitate(r, c->w.r, h->grav);
+ r = gravitate(c->w.r, r, h->grav);
                 if(h->gravstatic)
                         r = rectaddpt(r, sp);
- r = frame2client(nil, r);
+ return r;
         }else {
- r = client2frame(c->sel, c->w.r);
- r = gravitate(rd, r, h->grav);
+ r = client2frame(nil, rd);
+ r = gravitate(r, rd, h->grav);
                 if(h->gravstatic)
                         r = rectsubpt(r, sp);
- r = client2frame(nil, r);
- }
- return r;
+ return r;
+ }
 }
 
 Rectangle
@@ -608,7 +607,7 @@ wmname:
 /* Handlers */
 static void
 configreq_event(Window *w, XConfigureRequestEvent *e) {
- Rectangle r;
+ Rectangle r, cr;
         Frame *f;
         Client *c;
 
@@ -631,9 +630,10 @@ configreq_event(Window *w, XConfigureReq
                 c->border = e->border_width;
 
         r.max = addpt(r.min, r.max);
+ cr = r;
         r = gravclient(c, r);
 
- if((Dx(r) == Dx(screen->r)) && (Dy(r) == Dy(screen->r)))
+ if((Dx(cr) == Dx(screen->r)) && (Dy(cr) == Dy(screen->r)))
                 fullscreen(c, True);
 
         if(c->sel->area->floating)
@@ -866,7 +866,7 @@ apply_tags(Client *c, const char *tags)
                 cur = nil;
                 if(!strcmp(buf+n, "~"))
                         c->floating = add;
- else if(!strcmp(buf+n, "!") || strcmp(buf+n, "sel"))
+ else if(!strcmp(buf+n, "!") || !strcmp(buf+n, "sel"))
                         cur = screen->sel->name;
                 else if(!Mbsearch(buf+n, badtags, bsstrcmp))
                         cur = buf+n;
diff -r 896a3ea2651d -r 348ce251ee3f cmd/wmii/x11.h
--- a/cmd/wmii/x11.h Tue Jun 26 17:01:47 2007 -0400
+++ b/cmd/wmii/x11.h Tue Jun 26 19:41:59 2007 -0400
@@ -113,6 +113,7 @@ XRectangle XRect(Rectangle r);
 #define Pt(x, y) ((Point){(x), (y)})
 #define Rpt(p, q) ((Rectangle){p, q})
 #define Rect(x0, y0, x1, y1) ((Rectangle){Pt(x0, y0), Pt(x1, y1)})
-#define changeprop(w, prop, type, data, n) changeproperty(w, prop, type, ((sizeof(*(data)) == 8 ? 4 : sizeof(*(data))) \
- * 8), \
- (uchar*)(data), n)
+#define changeprop(w, prop, type, data, n) \
+ changeproperty(w, prop, type, \
+ ((sizeof(*(data)) == 8 ? 4 : sizeof(*(data))) * 8), \
+ (uchar*)(data), n)
Received on Wed Jun 27 2007 - 01:42:40 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:23 UTC