aboutsummaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorokan2009-12-08 16:52:17 +0000
committerokan2009-12-08 16:52:17 +0000
commit4c4c8d61c662cfe45e4aa6b6662a1c00947225db (patch)
tree31347967d8bbbcff21f607b81356ef16b863a6f4 /conf.c
parent0b0dd2e0d919b5b7aeede0dfc2c20b1c9147753d (diff)
downloadcwm-4c4c8d61c662cfe45e4aa6b6662a1c00947225db.tar.gz
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 'conf.c')
-rw-r--r--conf.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/conf.c b/conf.c
index 72a439f..b07a3de 100644
--- a/conf.c
+++ b/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 {