mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-31 16:02:43 +01:00 
			
		
		
		
	fix(Workspaces): index
This commit is contained in:
		| @@ -228,9 +228,15 @@ std::string waybar::modules::sway::Workspaces::getNextWorkspace() | |||||||
|  |  | ||||||
| uint16_t waybar::modules::sway::Workspaces::getWorkspaceIndex(const std::string &name) | uint16_t waybar::modules::sway::Workspaces::getWorkspaceIndex(const std::string &name) | ||||||
| { | { | ||||||
|   for (uint16_t i = 0; i < workspaces_.size(); i += 1) { |   uint16_t idx = 0; | ||||||
|     if (workspaces_[i]["name"].asString() == name) { |   for (const auto &workspace : workspaces_) { | ||||||
|       return i; |     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(); |   return workspaces_.size(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alex
					Alex