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

Method filterButtons

src/modules/sway/workspaces.cpp:226–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226bool Workspaces::filterButtons() {
227 bool needReorder = false;
228 for (auto it = buttons_.begin(); it != buttons_.end();) {
229 auto ws = std::find_if(workspaces_.begin(), workspaces_.end(),
230 [it](const auto& node) { return node["name"].asString() == it->first; });
231 if (ws == workspaces_.end() ||
232 (!config_["all-outputs"].asBool() && (*ws)["output"].asString() != bar_.output->name)) {
233 it = buttons_.erase(it);
234 needReorder = true;
235 } else {
236 ++it;
237 }
238 }
239 return needReorder;
240}
241
242bool Workspaces::hasFlag(const Json::Value& node, const std::string& flag) {
243 if (node[flag].asBool()) {

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected