1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-03 04:33:30 -05:00

fix(modules): Warmup module on start

This commit is contained in:
Michael Carlberg 2017-01-12 20:29:08 +01:00
parent c2ac7fde67
commit 92cc4d6f40
2 changed files with 4 additions and 4 deletions

View file

@ -11,16 +11,15 @@ namespace modules {
using module<Impl>::module;
void start() {
CAST_MOD(Impl)->update();
CAST_MOD(Impl)->broadcast();
this->m_mainthread = thread(&event_module::runner, this);
}
protected:
void runner() {
try {
// Warm up the module output before entering the loop
CAST_MOD(Impl)->update();
CAST_MOD(Impl)->broadcast();
while (this->running()) {
CAST_MOD(Impl)->idle();

View file

@ -13,6 +13,7 @@ namespace modules {
using module<Impl>::module;
void start() {
CAST_MOD(Impl)->update();
this->m_mainthread = thread(&timer_module::runner, this);
}