checking result of XGetClassHint, removed some obsolete lines in initfont() 26f41c90
Anselm R Garbe · 2008-08-29 10:13 1 file(s) · +3 −5
dwm.c +3 −5
233 233
static Client *stack = NULL;
234 234
static Cursor cursor[CurLast];
235 235
static Display *dpy;
236 -
static DC dc = {0};
236 +
static DC dc;
237 237
static Layout *lt[] = { NULL, NULL };
238 238
static Window root, barwin;
239 239
/* configuration, allows nested code to access above variables */
250 250
	XClassHint ch = { 0 };
251 251
252 252
	/* rule matching */
253 -
	XGetClassHint(dpy, c->win, &ch);
253 +
	if(XGetClassHint(dpy, c->win, &ch) == 0)
254 +
		return;
254 255
	for(i = 0; i < LENGTH(rules); i++) {
255 256
		r = &rules[i];
256 257
		if((!r->title || strstr(c->name, r->title))
796 797
		}
797 798
	}
798 799
	else {
799 -
		if(dc.font.xfont)
800 -
			XFreeFont(dpy, dc.font.xfont);
801 -
		dc.font.xfont = NULL;
802 800
		if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
803 801
		&& !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
804 802
			die("error, cannot load font: '%s'\n", fontstr);