| 123 | } |
| 124 | |
| 125 | void waybar::Client::handleMonitorRemoved(Glib::RefPtr<Gdk::Monitor> monitor) { |
| 126 | spdlog::debug("Output removed: {} {}", monitor->get_manufacturer().c_str(), |
| 127 | monitor->get_model().c_str()); |
| 128 | /* This event can be triggered from wl_display_roundtrip called by GTK or our code. |
| 129 | * Defer destruction of bars for the output to the next iteration of the event loop to avoid |
| 130 | * deleting objects referenced by currently executed code. |
| 131 | */ |
| 132 | Glib::signal_idle().connect_once( |
| 133 | sigc::bind(sigc::mem_fun(*this, &Client::handleDeferredMonitorRemoval), monitor), |
| 134 | Glib::PRIORITY_HIGH_IDLE); |
| 135 | } |
| 136 | |
| 137 | void waybar::Client::handleDeferredMonitorRemoval(Glib::RefPtr<Gdk::Monitor> monitor) { |
| 138 | for (auto it = bars.begin(); it != bars.end();) { |
nothing calls this directly
no outgoing calls
no test coverage detected