mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
move the rest of xft init into screen_conf, since most of it is based on
config parameters.
This commit is contained in:
parent
dac00a232f
commit
e41c84c752
1
calmwm.h
1
calmwm.h
@ -446,7 +446,6 @@ void conf_ungrab(struct conf *, struct keybinding *);
|
||||
|
||||
void font_draw(struct screen_ctx *, const char *,
|
||||
Drawable, int, int, int);
|
||||
void font_init(struct screen_ctx *, const char *);
|
||||
int font_width(XftFont *, const char *, int);
|
||||
|
||||
void xev_loop(void);
|
||||
|
9
conf.c
9
conf.c
@ -103,7 +103,14 @@ conf_screen(struct screen_ctx *sc)
|
||||
|
||||
sc->gap = Conf.gap;
|
||||
|
||||
font_init(sc, Conf.font);
|
||||
sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
|
||||
sc->visual, sc->colormap);
|
||||
if (sc->xftdraw == NULL)
|
||||
errx(1, "XftDrawCreate");
|
||||
|
||||
sc->xftfont = XftFontOpenName(X_Dpy, sc->which, Conf.font);
|
||||
if (sc->xftfont == NULL)
|
||||
errx(1, "XftFontOpenName");
|
||||
|
||||
for (i = 0; i < CWM_COLOR_MAX; i++) {
|
||||
if (*Conf.color[i] == '\0')
|
||||
|
13
font.c
13
font.c
@ -30,19 +30,6 @@
|
||||
|
||||
#include "calmwm.h"
|
||||
|
||||
void
|
||||
font_init(struct screen_ctx *sc, const char *name)
|
||||
{
|
||||
sc->xftdraw = XftDrawCreate(X_Dpy, sc->rootwin,
|
||||
sc->visual, sc->colormap);
|
||||
if (sc->xftdraw == NULL)
|
||||
errx(1, "XftDrawCreate");
|
||||
|
||||
sc->xftfont = XftFontOpenName(X_Dpy, sc->which, name);
|
||||
if (sc->xftfont == NULL)
|
||||
errx(1, "XftFontOpenName");
|
||||
}
|
||||
|
||||
int
|
||||
font_width(XftFont *xftfont, const char *text, int len)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user