Xinqi Bao's Git
projects
/
dwm.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
73ec124
)
checking result of XGetClassHint, removed some obsolete lines in initfont()
author
Anselm R Garbe <
[email protected]
>
Fri, 29 Aug 2008 09:13:47 +0000
(10:13 +0100)
committer
Anselm R Garbe <
[email protected]
>
Fri, 29 Aug 2008 09:13:47 +0000
(10:13 +0100)
dwm.c
patch
|
blob
|
history
diff --git
a/dwm.c
b/dwm.c
index
7faad22
..
d7d8bff
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-233,7
+233,7
@@
static Client *sel = NULL;
static Client *stack = NULL;
static Cursor cursor[CurLast];
static Display *dpy;
static Client *stack = NULL;
static Cursor cursor[CurLast];
static Display *dpy;
-static DC dc
= {0}
;
+static DC dc;
static Layout *lt[] = { NULL, NULL };
static Window root, barwin;
/* configuration, allows nested code to access above variables */
static Layout *lt[] = { NULL, NULL };
static Window root, barwin;
/* configuration, allows nested code to access above variables */
@@
-250,7
+250,8
@@
applyrules(Client *c) {
XClassHint ch = { 0 };
/* rule matching */
XClassHint ch = { 0 };
/* rule matching */
- XGetClassHint(dpy, c->win, &ch);
+ if(XGetClassHint(dpy, c->win, &ch) == 0)
+ return;
for(i = 0; i < LENGTH(rules); i++) {
r = &rules[i];
if((!r->title || strstr(c->name, r->title))
for(i = 0; i < LENGTH(rules); i++) {
r = &rules[i];
if((!r->title || strstr(c->name, r->title))
@@
-796,9
+797,6
@@
initfont(const char *fontstr) {
}
}
else {
}
}
else {
- if(dc.font.xfont)
- XFreeFont(dpy, dc.font.xfont);
- dc.font.xfont = NULL;
if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
&& !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
die("error, cannot load font: '%s'\n", fontstr);
if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))
&& !(dc.font.xfont = XLoadQueryFont(dpy, "fixed")))
die("error, cannot load font: '%s'\n", fontstr);