diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2009-12-08 16:52:18 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2009-12-08 16:52:18 +0000 |
commit | ba4890abf2f766ac715135a2a4b42895a90a5a9b (patch) | |
tree | 03f0c85988a6375f3c0c348d786661e4ec42751f /app/cwm/conf.c | |
parent | 833470ed20347a2d534ed1a02c578ffa97d78553 (diff) |
start fixing screen_ctx usage, for it is utterly broken. bring font
into screen_ctx and start passing screen_ctx around to in order get rid
of Curscreen; fixup per-screen config colors the same way.
diff mostly from oga@, with a bit harsher reaction to the state of screen_ctx.
"please commit" oga@
Diffstat (limited to 'app/cwm/conf.c')
-rw-r--r-- | app/cwm/conf.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/app/cwm/conf.c b/app/cwm/conf.c index 72a439f09..b07a3de86 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: conf.c,v 1.71 2009/12/07 19:42:59 okan Exp $ + * $Id: conf.c,v 1.72 2009/12/08 16:52:17 okan Exp $ */ #include "headers.h" @@ -51,23 +51,16 @@ conf_cmd_add(struct conf *c, char *image, char *label, int flags) } void -conf_font(struct conf *c) +conf_font(struct conf *c, struct screen_ctx *sc) { - struct screen_ctx *sc; - - sc = screen_current(); - - c->DefaultFont = font_make(sc, c->DefaultFontName); - c->FontHeight = font_ascent() + font_descent() + 1; + sc->font = font_make(sc, c->DefaultFontName); + sc->fontheight = font_ascent(sc) + font_descent(sc) + 1; } void -conf_color(struct conf *c) +conf_color(struct conf *c, struct screen_ctx *sc) { - struct screen_ctx *sc; - int i; - - sc = screen_current(); + int i; for (i = 0; i < CWM_COLOR_MAX; i++) { xu_freecolor(sc, sc->color[i].pixel); @@ -78,6 +71,7 @@ conf_color(struct conf *c) void conf_reload(struct conf *c) { + struct screen_ctx *sc; struct client_ctx *cc; if (parse_config(c->conf_path, c) == -1) { @@ -85,10 +79,12 @@ conf_reload(struct conf *c) return; } - conf_color(c); TAILQ_FOREACH(cc, &Clientq, entry) client_draw_border(cc); - conf_font(c); + TAILQ_FOREACH(sc, &Screenq, entry) { + conf_color(c, sc); + conf_font(c, sc); + } } static struct { |