| 135 | } |
| 136 | |
| 137 | void waybar::Client::handleDeferredMonitorRemoval(Glib::RefPtr<Gdk::Monitor> monitor) { |
| 138 | for (auto it = bars.begin(); it != bars.end();) { |
| 139 | if ((*it)->output->monitor == monitor) { |
| 140 | auto output_name = (*it)->output->name; |
| 141 | (*it)->window.hide(); |
| 142 | gtk_app->remove_window((*it)->window); |
| 143 | it = bars.erase(it); |
| 144 | spdlog::info("Bar removed from output: {}", output_name); |
| 145 | } else { |
| 146 | ++it; |
| 147 | } |
| 148 | } |
| 149 | outputs_.remove_if([&monitor](const auto& output) { return output.monitor == monitor; }); |
| 150 | } |
| 151 | |
| 152 | const std::string waybar::Client::getStyle(const std::string& style, |
| 153 | std::optional<Appearance> appearance = std::nullopt) { |