mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix(Workspaces): index
This commit is contained in:
parent
add9e925f4
commit
93173851d3
@ -228,9 +228,15 @@ std::string waybar::modules::sway::Workspaces::getNextWorkspace()
|
||||
|
||||
uint16_t waybar::modules::sway::Workspaces::getWorkspaceIndex(const std::string &name)
|
||||
{
|
||||
for (uint16_t i = 0; i < workspaces_.size(); i += 1) {
|
||||
if (workspaces_[i]["name"].asString() == name) {
|
||||
return i;
|
||||
uint16_t idx = 0;
|
||||
for (const auto &workspace : workspaces_) {
|
||||
if (workspace["name"].asString() == name) {
|
||||
return idx;
|
||||
}
|
||||
if (!config_["all-outputs"].asBool() && workspace["output"].asString() != bar_.output_name) {
|
||||
// Nothing here
|
||||
} else {
|
||||
idx += 1;
|
||||
}
|
||||
}
|
||||
return workspaces_.size();
|
||||
|
Loading…
Reference in New Issue
Block a user