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:
parent
c2ac7fde67
commit
92cc4d6f40
2 changed files with 4 additions and 4 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace modules {
|
|||
using module<Impl>::module;
|
||||
|
||||
void start() {
|
||||
CAST_MOD(Impl)->update();
|
||||
this->m_mainthread = thread(&timer_module::runner, this);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue