mirror of
https://github.com/Alexays/Waybar.git
synced 2025-10-29 19:46:32 +00:00
Compare commits
2 Commits
71b01fe58f
...
39d6d80f64
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39d6d80f64 | ||
|
|
b4d95b405c |
@ -69,14 +69,13 @@ void Workspaces::createWorkspace(Json::Value const &workspace_data,
|
||||
spdlog::debug("Creating workspace {}", workspaceName);
|
||||
|
||||
// avoid recreating existing workspaces
|
||||
auto workspace =
|
||||
std::ranges::find_if(m_workspaces, [&](std::unique_ptr<Workspace> const &w) {
|
||||
if (workspaceId > 0) {
|
||||
return w->id() == workspaceId;
|
||||
}
|
||||
return (workspaceName.starts_with("special:") && workspaceName.substr(8) == w->name()) ||
|
||||
workspaceName == w->name();
|
||||
});
|
||||
auto workspace = std::ranges::find_if(m_workspaces, [&](std::unique_ptr<Workspace> const &w) {
|
||||
if (workspaceId > 0) {
|
||||
return w->id() == workspaceId;
|
||||
}
|
||||
return (workspaceName.starts_with("special:") && workspaceName.substr(8) == w->name()) ||
|
||||
workspaceName == w->name();
|
||||
});
|
||||
|
||||
if (workspace != m_workspaces.end()) {
|
||||
// don't recreate workspace, but update persistency if necessary
|
||||
@ -295,7 +294,7 @@ void Workspaces::loadPersistentWorkspacesFromWorkspaceRules(const Json::Value &c
|
||||
continue;
|
||||
}
|
||||
auto workspace = rule.isMember("defaultName") ? rule["defaultName"].asString()
|
||||
: rule["workspaceString"].asString();
|
||||
: rule["workspaceString"].asString();
|
||||
|
||||
// The prefix "name:" cause mismatches with workspace names taken anywhere else.
|
||||
if (workspace.starts_with("name:")) {
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "modules/sni/item.hpp"
|
||||
|
||||
#include <gdkmm/general.h>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user