mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-11-04 01:32:42 +01:00 
			
		
		
		
	Fix workspace scroll wrapping off the end of the list
This commit is contained in:
		@@ -223,7 +223,7 @@ const std::string Workspaces::getCycleWorkspace(std::vector<Json::Value>::iterat
 | 
			
		||||
  else if (!prev && it != workspaces_.end())
 | 
			
		||||
    ++it;
 | 
			
		||||
  if (!prev && it == workspaces_.end()) {
 | 
			
		||||
    return (*(++workspaces_.begin()))["name"].asString();
 | 
			
		||||
    return (*(workspaces_.begin()))["name"].asString();
 | 
			
		||||
  }
 | 
			
		||||
  return (*it)["name"].asString();
 | 
			
		||||
}
 | 
			
		||||
@@ -250,4 +250,4 @@ void Workspaces::onButtonReady(const Json::Value &node, Gtk::Button &button) {
 | 
			
		||||
 | 
			
		||||
Workspaces::operator Gtk::Widget &() { return box_; }
 | 
			
		||||
 | 
			
		||||
}  // namespace waybar::modules::sway
 | 
			
		||||
}  // namespace waybar::modules::sway
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user