applied Peters patch, applied yiyus hint to initfont 1fafcb18
arg@suckless.org · 2007-09-19 17:32 1 file(s) · +12 −12
dwm.c +12 −12
334 334
		if(CLEANMASK(ev->state) != MODKEY)
335 335
			return;
336 336
		if(ev->button == Button1) {
337 -
			if(!isarrange(floating) && !c->isfloating)
338 -
				togglefloating(NULL);
339 -
			else
337 +
			if(isarrange(floating) || c->isfloating)
340 338
				restack();
339 +
			else
340 +
				togglefloating(NULL);
341 341
			movemouse(c);
342 342
		}
343 343
		else if(ev->button == Button2) {
347 347
				zoom(NULL);
348 348
		}
349 349
		else if(ev->button == Button3 && !c->isfixed) {
350 -
			if(!isarrange(floating) && !c->isfloating)
351 -
				togglefloating(NULL);
352 -
			else
350 +
			if(isarrange(floating) || c->isfloating)
353 351
				restack();
352 +
			else
353 +
				togglefloating(NULL);
354 354
			resizemouse(c);
355 355
		}
356 356
	}
444 444
configurenotify(XEvent *e) {
445 445
	XConfigureEvent *ev = &e->xconfigure;
446 446
447 -
	if (ev->window == root && (ev->width != sw || ev->height != sh)) {
447 +
	if(ev->window == root && (ev->width != sw || ev->height != sh)) {
448 448
		sw = ev->width;
449 449
		sh = ev->height;
450 450
		XFreePixmap(dpy, dc.drawable);
883 883
			XFreeFont(dpy, dc.font.xfont);
884 884
		dc.font.xfont = NULL;
885 885
		if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
886 -
		|| !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
886 +
		&& !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
887 887
			eprint("error, cannot load font: '%s'\n", fontstr);
888 888
		dc.font.ascent = dc.font.xfont->ascent;
889 889
		dc.font.descent = dc.font.xfont->descent;
1404 1404
	if(arg == NULL)
1405 1405
		mwfact = MWFACT;
1406 1406
	else if(1 == sscanf(arg, "%lf", &delta)) {
1407 -
		if(arg[0] != '+' && arg[0] != '-')
1408 -
			mwfact = delta;
1409 -
		else
1407 +
		if(arg[0] == '+' || arg[0] == '-')
1410 1408
			mwfact += delta;
1409 +
		else
1410 +
			mwfact = delta;
1411 1411
		if(mwfact < 0.1)
1412 1412
			mwfact = 0.1;
1413 1413
		else if(mwfact > 0.9)
1644 1644
	}
1645 1645
	else {
1646 1646
		resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
1647 -
		if (!sel->wasfloating)
1647 +
		if(!sel->wasfloating)
1648 1648
			togglefloating(NULL);
1649 1649
	}
1650 1650
	drawbar();