mirror of
https://github.com/rad4day/Waybar.git
synced 2025-09-15 23:22:31 +02:00
fix(gtk): use idle to avoid mutex
This commit is contained in:
@@ -8,9 +8,11 @@ waybar::modules::Custom::Custom(std::string name, Json::Value config)
|
||||
std::cerr << name + " has no exec path." << std::endl;
|
||||
return;
|
||||
}
|
||||
_thread = [this] {
|
||||
update();
|
||||
int interval = _config["interval"] ? _config["inveral"].asInt() : 30;
|
||||
int interval = _config["interval"] ? _config["inveral"].asInt() : 30;
|
||||
_thread = [this, interval] {
|
||||
Glib::signal_idle().connect_once([this] {
|
||||
update();
|
||||
});
|
||||
_thread.sleep_for(chrono::seconds(interval));
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user