diff options
Diffstat (limited to 'bar.c')
| -rw-r--r-- | bar.c | 13 |
1 files changed, 9 insertions, 4 deletions
| @@ -69,7 +69,8 @@ initfont(const char *fontstr) { | |||
| 69 | if(dc.font.xfont) | 69 | if(dc.font.xfont) |
| 70 | XFreeFont(dpy, dc.font.xfont); | 70 | XFreeFont(dpy, dc.font.xfont); |
| 71 | dc.font.xfont = NULL; | 71 | dc.font.xfont = NULL; |
| 72 | if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr))) | 72 | if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr)) |
| 73 | || !(dc.font.xfont = XLoadQueryFont(dpy, "fixed"))) | ||
| 73 | eprint("error, cannot load font: '%s'\n", fontstr); | 74 | eprint("error, cannot load font: '%s'\n", fontstr); |
| 74 | dc.font.ascent = dc.font.xfont->ascent; | 75 | dc.font.ascent = dc.font.xfont->ascent; |
| 75 | dc.font.descent = dc.font.xfont->descent; | 76 | dc.font.descent = dc.font.xfont->descent; |
| @@ -186,9 +187,7 @@ drawbar(void) { | |||
| 186 | } | 187 | } |
| 187 | 188 | ||
| 188 | void | 189 | void |
| 189 | initbar(void) { | 190 | initstyle(void) { |
| 190 | XSetWindowAttributes wa; | ||
| 191 | |||
| 192 | dc.norm[ColBorder] = initcolor(NORMBORDERCOLOR); | 191 | dc.norm[ColBorder] = initcolor(NORMBORDERCOLOR); |
| 193 | dc.norm[ColBG] = initcolor(NORMBGCOLOR); | 192 | dc.norm[ColBG] = initcolor(NORMBGCOLOR); |
| 194 | dc.norm[ColFG] = initcolor(NORMFGCOLOR); | 193 | dc.norm[ColFG] = initcolor(NORMFGCOLOR); |
| @@ -197,6 +196,12 @@ initbar(void) { | |||
| 197 | dc.sel[ColFG] = initcolor(SELFGCOLOR); | 196 | dc.sel[ColFG] = initcolor(SELFGCOLOR); |
| 198 | initfont(FONT); | 197 | initfont(FONT); |
| 199 | dc.h = bh = dc.font.height + 2; | 198 | dc.h = bh = dc.font.height + 2; |
| 199 | } | ||
| 200 | |||
| 201 | void | ||
| 202 | initbar(void) { | ||
| 203 | XSetWindowAttributes wa; | ||
| 204 | |||
| 200 | wa.override_redirect = 1; | 205 | wa.override_redirect = 1; |
| 201 | wa.background_pixmap = ParentRelative; | 206 | wa.background_pixmap = ParentRelative; |
| 202 | wa.event_mask = ButtonPressMask | ExposureMask; | 207 | wa.event_mask = ButtonPressMask | ExposureMask; |
