bar: call refresh() after all modules have been loaded

This also means that modules do *not* have to call bar->refresh() just
before/after calling module_signal_ready().

As long as the module's initial state has been correctly/completely
set up before it calls module_signal_ready(), the module *only* has to
call bar->refresh() when it's state changes.
This commit is contained in:
Daniel Eklöf 2018-12-26 11:48:09 +01:00
parent 3af0280304
commit 5306ebd4ed
3 changed files with 6 additions and 3 deletions

4
bar.c
View file

@ -171,6 +171,8 @@ expose(const struct bar *_bar)
}
}
static void refresh(const struct bar *bar);
static int
run(struct bar_run_context *run_ctx)
{
@ -428,6 +430,8 @@ run(struct bar_run_context *run_ctx)
close(ready_fd);
LOG_DBG("all modules started");
refresh(_bar);
int fd = xcb_get_file_descriptor(bar->conn);
while (true) {