fix(gtk): use idle to avoid mutex

This commit is contained in:
Alexis
2018-08-10 23:21:21 +02:00
parent 95f1ab471a
commit 2512d51564
15 changed files with 42 additions and 71 deletions

View File

@ -20,10 +20,10 @@ waybar::modules::Battery::Battery(Json::Value config)
}
_label.get_style_context()->add_class("battery");
_thread = [this] {
int interval = _config["interval"] ? _config["inveral"].asInt() : 1;
_thread = [this, interval] {
update();
_thread.sleep_for(chrono::minutes(1));
_thread.sleep_for(chrono::seconds(interval));
};
}