From 4d117da0ecb49e657d12200d6a3a57f2e232b0ba Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 16 Jan 2008 17:50:37 +0100 Subject: [PATCH] preinit in config.c --- awesome.c | 3 --- config.c | 2 ++ statusbar.c | 4 +--- statusbar.h | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/awesome.c b/awesome.c index 59c2cb51..4c9d6a69 100644 --- a/awesome.c +++ b/awesome.c @@ -135,9 +135,6 @@ setup(int screen) grabkeys(phys_screen); - for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next) - statusbar_preinit(statusbar, screen); - for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next) statusbar_init(statusbar); } diff --git a/config.c b/config.c index 791c52ac..60afd76a 100644 --- a/config.c +++ b/config.c @@ -341,7 +341,9 @@ config_parse_screen(cfg_t *cfg, int screen) statusbar->height = cfg_getint(cfgsectmp, "height"); statusbar->width = cfg_getint(cfgsectmp, "width"); statusbar->name = a_strdup(cfg_title(cfgsectmp)); + statusbar->screen = screen; create_widgets(cfgsectmp, statusbar); + statusbar_preinit(statusbar); statusbar_list_push(&virtscreen->statusbar, statusbar); } diff --git a/statusbar.c b/statusbar.c index 85978733..5afa9e25 100644 --- a/statusbar.c +++ b/statusbar.c @@ -162,11 +162,9 @@ statusbar_display(Statusbar *statusbar) } void -statusbar_preinit(Statusbar *statusbar, int screen) +statusbar_preinit(Statusbar *statusbar) { Widget *widget; - - statusbar->screen = screen; if(statusbar->height <= 0) { diff --git a/statusbar.h b/statusbar.h index d2be6240..68ed6d02 100644 --- a/statusbar.h +++ b/statusbar.h @@ -25,7 +25,7 @@ #include "structs.h" void statusbar_refresh(void); -void statusbar_preinit(Statusbar *, int); +void statusbar_preinit(Statusbar *); void statusbar_init(Statusbar *); void statusbar_display(Statusbar *); Position statusbar_get_position_from_str(const char *);