fix: workspace special wasn't removed

fixes  #2505

Co-authored-by: Gabriel Fox <Inbox@GabrielFox.Dev>
This commit is contained in:
Brenno Lemos 2023-09-25 17:12:51 -03:00
parent 6997b34a81
commit 6e48b236a1
1 changed files with 4 additions and 2 deletions

View File

@ -238,8 +238,10 @@ void Workspaces::create_workspace(Json::Value &value) {
}
void Workspaces::remove_workspace(std::string name) {
auto workspace = std::find_if(workspaces_.begin(), workspaces_.end(),
[&](std::unique_ptr<Workspace> &x) { return x->name() == name; });
auto workspace =
std::find_if(workspaces_.begin(), workspaces_.end(), [&](std::unique_ptr<Workspace> &x) {
return (name.starts_with("special:") && name.substr(8) == x->name()) || name == x->name();
});
if (workspace == workspaces_.end()) {
// happens when a workspace on another monitor is destroyed