MCPcopy Create free account
hub / github.com/Alexays/Waybar / handleMonitorRemoved

Method handleMonitorRemoved

src/client.cpp:125–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void 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
137void waybar::Client::handleDeferredMonitorRemoval(Glib::RefPtr<Gdk::Monitor> monitor) {
138 for (auto it = bars.begin(); it != bars.end();) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected