preinit in config.c

This commit is contained in:
Julien Danjou 2008-01-16 17:50:37 +01:00
parent 5180613fe5
commit 4d117da0ec
4 changed files with 4 additions and 7 deletions

View File

@ -135,9 +135,6 @@ setup(int screen)
grabkeys(phys_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) for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next)
statusbar_init(statusbar); statusbar_init(statusbar);
} }

View File

@ -341,7 +341,9 @@ config_parse_screen(cfg_t *cfg, int screen)
statusbar->height = cfg_getint(cfgsectmp, "height"); statusbar->height = cfg_getint(cfgsectmp, "height");
statusbar->width = cfg_getint(cfgsectmp, "width"); statusbar->width = cfg_getint(cfgsectmp, "width");
statusbar->name = a_strdup(cfg_title(cfgsectmp)); statusbar->name = a_strdup(cfg_title(cfgsectmp));
statusbar->screen = screen;
create_widgets(cfgsectmp, statusbar); create_widgets(cfgsectmp, statusbar);
statusbar_preinit(statusbar);
statusbar_list_push(&virtscreen->statusbar, statusbar); statusbar_list_push(&virtscreen->statusbar, statusbar);
} }

View File

@ -162,11 +162,9 @@ statusbar_display(Statusbar *statusbar)
} }
void void
statusbar_preinit(Statusbar *statusbar, int screen) statusbar_preinit(Statusbar *statusbar)
{ {
Widget *widget; Widget *widget;
statusbar->screen = screen;
if(statusbar->height <= 0) if(statusbar->height <= 0)
{ {

View File

@ -25,7 +25,7 @@
#include "structs.h" #include "structs.h"
void statusbar_refresh(void); void statusbar_refresh(void);
void statusbar_preinit(Statusbar *, int); void statusbar_preinit(Statusbar *);
void statusbar_init(Statusbar *); void statusbar_init(Statusbar *);
void statusbar_display(Statusbar *); void statusbar_display(Statusbar *);
Position statusbar_get_position_from_str(const char *); Position statusbar_get_position_from_str(const char *);