summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-08-29 10:13:47 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-08-29 10:13:47 +0100
commit26f41c905529c6df908980c731077fa340a9e1c8 (patch)
tree94c32b48d6274248efd470b295e188f5fb19a102 /dwm.c
parentmerged my changes (diff)
downloaddwm-26f41c905529c6df908980c731077fa340a9e1c8.tar.gz
dwm-26f41c905529c6df908980c731077fa340a9e1c8.zip
checking result of XGetClassHint, removed some obsolete lines in initfont()
Diffstat (limited to '')
-rw-r--r--dwm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/dwm.c b/dwm.c
index 7faad22..d7d8bff 100644
--- a/dwm.c
+++ b/dwm.c
@@ -233,7 +233,7 @@ static Client *sel = NULL;
233static Client *stack = NULL; 233static Client *stack = NULL;
234static Cursor cursor[CurLast]; 234static Cursor cursor[CurLast];
235static Display *dpy; 235static Display *dpy;
236static DC dc = {0}; 236static DC dc;
237static Layout *lt[] = { NULL, NULL }; 237static Layout *lt[] = { NULL, NULL };
238static Window root, barwin; 238static Window root, barwin;
239/* configuration, allows nested code to access above variables */ 239/* configuration, allows nested code to access above variables */
@@ -250,7 +250,8 @@ applyrules(Client *c) {
250 XClassHint ch = { 0 }; 250 XClassHint ch = { 0 };
251 251
252 /* rule matching */ 252 /* rule matching */
253 XGetClassHint(dpy, c->win, &ch); 253 if(XGetClassHint(dpy, c->win, &ch) == 0)
254 return;
254 for(i = 0; i < LENGTH(rules); i++) { 255 for(i = 0; i < LENGTH(rules); i++) {
255 r = &rules[i]; 256 r = &rules[i];
256 if((!r->title || strstr(c->name, r->title)) 257 if((!r->title || strstr(c->name, r->title))
@@ -796,9 +797,6 @@ initfont(const char *fontstr) {
796 } 797 }
797 } 798 }
798 else { 799 else {
799 if(dc.font.xfont)
800 XFreeFont(dpy, dc.font.xfont);
801 dc.font.xfont = NULL;
802 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr)) 800 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
803 && !(dc.font.xfont = XLoadQueryFont(dpy, "fixed"))) 801 && !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
804 die("error, cannot load font: '%s'\n", fontstr); 802 die("error, cannot load font: '%s'\n", fontstr);