X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=dbc49972399c1acd54018a8191880459fa7a8545;hp=ada272c6caf5d11223c8872002b462ae2ef5ead1;hb=88e6eb4a3a3552d6b503481164aafc1c994d5a50;hpb=08bcf721b436018306bdbb9fbaca87f941ee6441 diff --git a/dwm.c b/dwm.c index ada272c..dbc4997 100644 --- a/dwm.c +++ b/dwm.c @@ -166,7 +166,7 @@ void setmfact(const void *arg); void setup(void); void spawn(const void *arg); void tag(const void *arg); -uint textnw(const char *text, uint len); +int textnw(const char *text, uint len); void tile(void); void togglebar(const void *arg); void togglefloating(const void *arg); @@ -296,7 +296,8 @@ attachstack(Client *c) { void buttonpress(XEvent *e) { - uint i, x, mask; + uint i, mask; + int x; Client *c; XButtonPressedEvent *ev = &e->xbutton; @@ -551,8 +552,7 @@ drawsquare(Bool filled, Bool empty, Bool invert, ulong col[ColLast]) { void drawtext(const char *text, ulong col[ColLast], Bool invert) { - int i, x, y, h; - uint len, olen; + int i, x, y, h, len, olen; XRectangle r = { dc.x, dc.y, dc.w, dc.h }; char buf[256]; @@ -612,7 +612,7 @@ expose(XEvent *e) { void focus(Client *c) { - if(!c || (c && c->isbanned)) + if(!c || c->isbanned) for(c = stack; c && c->isbanned; c = c->snext); if(sel && sel != c) { grabbuttons(sel, False); @@ -622,14 +622,12 @@ focus(Client *c) { detachstack(c); attachstack(c); grabbuttons(c, True); - } - sel = c; - if(c) { XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); } else XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); + sel = c; drawbar(); } @@ -739,8 +737,7 @@ void grabbuttons(Client *c, Bool focused) { int i, j; uint buttons[] = { Button1, Button2, Button3 }; - uint modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask, - MODKEY|numlockmask|LockMask} ; + uint modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask, MODKEY|numlockmask|LockMask }; XUngrabButton(dpy, AnyButton, AnyModifier, c->win); if(focused) @@ -1312,7 +1309,8 @@ setmfact(const void *arg) { void setup(void) { - uint i, w; + uint i; + int w; XSetWindowAttributes wa; /* init screen */ @@ -1417,7 +1415,7 @@ tag(const void *arg) { } } -uint +int textnw(const char *text, uint len) { XRectangle r; @@ -1565,8 +1563,8 @@ updatebar(void) { void updategeom(void) { - int i; #ifdef XINERAMA + int i; XineramaScreenInfo *info = NULL; /* window area geometry */