applied Hiltjo's tiny cleanup patch, thanks! c1f8688b
Anselm R Garbe · 2010-09-25 13:39 1 file(s) · +8 −12
dwm.c +8 −12
372 372
		if(c->inch)
373 373
			*h -= *h % c->inch;
374 374
		/* restore base dimensions */
375 -
		*w += c->basew;
376 -
		*h += c->baseh;
377 -
		*w = MAX(*w, c->minw);
378 -
		*h = MAX(*h, c->minh);
375 +
		*w = MAX(*w + c->basew, c->minw);
376 +
		*h = MAX(*h + c->baseh, c->minh);
379 377
		if(c->maxw)
380 378
			*w = MIN(*w, c->maxw);
381 379
		if(c->maxh)
845 843
846 844
void
847 845
focusmon(const Arg *arg) {
848 -
	Monitor *m = NULL;
846 +
	Monitor *m;
849 847
850 848
	if(!mons->next)
851 849
		return;
1100 1098
	*c = cz;
1101 1099
	c->win = w;
1102 1100
	updatetitle(c);
1103 -
	if(XGetTransientForHint(dpy, w, &trans))
1104 -
		t = wintoclient(trans);
1105 -
	if(t) {
1101 +
	if(XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
1106 1102
		c->mon = t->mon;
1107 1103
		c->tags = t->tags;
1108 1104
	}
1117 1113
	c->h = c->oldh = wa->height;
1118 1114
	c->oldbw = wa->border_width;
1119 1115
	if(c->w == c->mon->mw && c->h == c->mon->mh) {
1120 -
		c->isfloating = 1;
1116 +
		c->isfloating = True;
1121 1117
		c->x = c->mon->mx;
1122 1118
		c->y = c->mon->my;
1123 1119
		c->bw = 0;
1273 1269
		switch (ev->atom) {
1274 1270
		default: break;
1275 1271
		case XA_WM_TRANSIENT_FOR:
1276 -
			XGetTransientForHint(dpy, c->win, &trans);
1277 -
			if(!c->isfloating && (c->isfloating = (wintoclient(trans) != NULL)))
1272 +
			if(!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) &&
1273 +
			   (c->isfloating = (wintoclient(trans))))
1278 1274
				arrange(c->mon);
1279 1275
			break;
1280 1276
		case XA_WM_NORMAL_HINTS:
1307 1303
			c->oldstate = c->isfloating;
1308 1304
			c->oldbw = c->bw;
1309 1305
			c->bw = 0;
1310 -
			c->isfloating = 1;
1306 +
			c->isfloating = True;
1311 1307
			resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
1312 1308
			XRaiseWindow(dpy, c->win);
1313 1309
		}