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

Method handleOutputDescription

src/client.cpp:104–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void waybar::Client::handleOutputDescription(void* data, struct zxdg_output_v1* /*xdg_output*/,
105 const char* description) {
106 auto* client = waybar::Client::inst();
107 try {
108 auto& output = client->getOutput(data);
109
110 // Description format: "identifier (name)"
111 auto s = std::string(description);
112 auto pos = s.find(" (");
113 output.identifier = pos != std::string::npos ? s.substr(0, pos) : s;
114 } catch (const std::exception& e) {
115 spdlog::warn("caught exception in zxdg_output_v1_listener::description: {}", e.what());
116 }
117}
118
119void waybar::Client::handleMonitorAdded(Glib::RefPtr<Gdk::Monitor> monitor) {
120 auto& output = outputs_.emplace_back();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected