[hackers] [dwm] applied Hiltjo's tiny cleanup patch, thanks! || Anselm R Garbe

From: <hg_AT_suckless.org>
Date: Sat, 25 Sep 2010 13:39:11 +0000 (UTC)

changeset: 1526:64eb02a74f2b
tag: tip
user: Anselm R Garbe <anselm_AT_garbe.us>
date: Sat Sep 25 13:39:08 2010 +0000
files: dwm.c
description:
applied Hiltjo's tiny cleanup patch, thanks!

diff -r c361034c5a1c -r 64eb02a74f2b dwm.c
--- a/dwm.c Sat Sep 11 19:00:18 2010 +0000
+++ b/dwm.c Sat Sep 25 13:39:08 2010 +0000
@@ -372,10 +372,8 @@
                 if(c->inch)
                         *h -= *h % c->inch;
                 /* restore base dimensions */
- *w += c->basew;
- *h += c->baseh;
- *w = MAX(*w, c->minw);
- *h = MAX(*h, c->minh);
+ *w = MAX(*w + c->basew, c->minw);
+ *h = MAX(*h + c->baseh, c->minh);
                 if(c->maxw)
                         *w = MIN(*w, c->maxw);
                 if(c->maxh)
@@ -845,7 +843,7 @@
 
 void
 focusmon(const Arg *arg) {
- Monitor *m = NULL;
+ Monitor *m;
 
         if(!mons->next)
                 return;
@@ -1100,9 +1098,7 @@
         *c = cz;
         c->win = w;
         updatetitle(c);
- if(XGetTransientForHint(dpy, w, &trans))
- t = wintoclient(trans);
- if(t) {
+ if(XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
                 c->mon = t->mon;
                 c->tags = t->tags;
         }
@@ -1117,7 +1113,7 @@
         c->h = c->oldh = wa->height;
         c->oldbw = wa->border_width;
         if(c->w == c->mon->mw && c->h == c->mon->mh) {
- c->isfloating = 1;
+ c->isfloating = True;
                 c->x = c->mon->mx;
                 c->y = c->mon->my;
                 c->bw = 0;
@@ -1273,8 +1269,8 @@
                 switch (ev->atom) {
                 default: break;
                 case XA_WM_TRANSIENT_FOR:
- XGetTransientForHint(dpy, c->win, &trans);
- if(!c->isfloating && (c->isfloating = (wintoclient(trans) != NULL)))
+ if(!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) &&
+ (c->isfloating = (wintoclient(trans))))
                                 arrange(c->mon);
                         break;
                 case XA_WM_NORMAL_HINTS:
@@ -1307,7 +1303,7 @@
                         c->oldstate = c->isfloating;
                         c->oldbw = c->bw;
                         c->bw = 0;
- c->isfloating = 1;
+ c->isfloating = True;
                         resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
                         XRaiseWindow(dpy, c->win);
                 }
Received on Sat Sep 25 2010 - 15:39:11 CEST

This archive was generated by hypermail 2.2.0 : Sat Sep 25 2010 - 15:48:04 CEST