Merge pull request #87 from David96/master

Fix workspaces not being removed from bar when moved to another output
This commit is contained in:
Alex 2018-11-05 21:06:53 +01:00 committed by GitHub
commit 0933aad75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -42,7 +42,9 @@ auto waybar::modules::sway::Workspaces::update() -> void
for (auto it = buttons_.begin(); it != buttons_.end();) {
auto ws = std::find_if(workspaces_.begin(), workspaces_.end(),
[it](auto node) -> bool { return node["name"].asString() == it->first; });
if (ws == workspaces_.end()) {
if (ws == workspaces_.end() ||
(!config_["all-outputs"].asBool() &&
(*ws)["output"].asString() != bar_.output_name)) {
it = buttons_.erase(it);
needReorder = true;
} else {