mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Idle inhibitor toggle no longer update all modules - a list of idle inhibitors is maintained on the Client.
This commit is contained in:
12
src/bar.cpp
12
src/bar.cpp
@ -461,15 +461,3 @@ auto waybar::Bar::setupWidgets() -> void {
|
||||
right_.pack_end(*module, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
void waybar::Bar::updateAll() {
|
||||
for (auto const& module : modules_left_) {
|
||||
module->update();
|
||||
}
|
||||
for (auto const& module : modules_center_) {
|
||||
module->update();
|
||||
}
|
||||
for (auto const& module : modules_right_) {
|
||||
module->update();
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ waybar::modules::IdleInhibitor::IdleInhibitor(const std::string& id, const Bar&
|
||||
event_box_.add_events(Gdk::BUTTON_PRESS_MASK);
|
||||
event_box_.signal_button_press_event().connect(
|
||||
sigc::mem_fun(*this, &IdleInhibitor::handleToggle));
|
||||
waybar::Client::inst()->idle_inhibitor_modules.push_back(this);
|
||||
dp.emit();
|
||||
}
|
||||
|
||||
@ -57,9 +58,11 @@ bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) {
|
||||
click_param = status_;
|
||||
}
|
||||
|
||||
// Make all modules update
|
||||
for (auto const& bar : waybar::Client::inst()->bars) {
|
||||
bar->updateAll();
|
||||
// Make all other idle inhibitor modules update
|
||||
for (auto const& module : waybar::Client::inst()->idle_inhibitor_modules) {
|
||||
if (module != this) {
|
||||
module->update();
|
||||
}
|
||||
}
|
||||
|
||||
ALabel::handleToggle(e);
|
||||
|
Reference in New Issue
Block a user