diff options
Diffstat (limited to 'src/layout/supplementary/WorkspaceAlgoMatcher.cpp')
| -rw-r--r-- | src/layout/supplementary/WorkspaceAlgoMatcher.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/layout/supplementary/WorkspaceAlgoMatcher.cpp b/src/layout/supplementary/WorkspaceAlgoMatcher.cpp index fe868038..08744e12 100644 --- a/src/layout/supplementary/WorkspaceAlgoMatcher.cpp +++ b/src/layout/supplementary/WorkspaceAlgoMatcher.cpp @@ -4,6 +4,7 @@ #include "../../config/shared/workspace/WorkspaceRuleManager.hpp" #include "../algorithm/Algorithm.hpp" +#include "../algorithm/TiledAlgorithm.hpp" #include "../space/Space.hpp" #include "../algorithm/floating/default/DefaultFloatingAlgorithm.hpp" @@ -124,7 +125,9 @@ void CWorkspaceAlgoMatcher::updateWorkspaceLayouts() { const auto LAYOUT_TO_USE = tiledAlgoForWorkspace(ws.lock()); - if (m_algoNames.contains(&typeid(*TILED_ALGO.get())) && m_algoNames.at(&typeid(*TILED_ALGO.get())) == LAYOUT_TO_USE) + const auto CURRENT_LAYOUT = getNameForTiledAlgo(TILED_ALGO.get()); + + if (CURRENT_LAYOUT == LAYOUT_TO_USE && m_tiledAlgos.contains(LAYOUT_TO_USE)) continue; // needs a switchup @@ -132,6 +135,16 @@ void CWorkspaceAlgoMatcher::updateWorkspaceLayouts() { } } +std::string CWorkspaceAlgoMatcher::getNameForTiledAlgo(const ITiledAlgorithm* algo) { + if (!algo) + return "unknown"; + + if (const auto name = algo->layoutName(); name.has_value()) + return *name; + + return getNameForTiledAlgo(&typeid(*algo)); +} + std::string CWorkspaceAlgoMatcher::getNameForTiledAlgo(const std::type_info* type) { if (m_algoNames.contains(type)) return m_algoNames.at(type); |
