From 8726a7363eb9213235e6e23657668e0daac39a5b Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:52:37 -0400 Subject: config: cleanup the entire config infrastructure (#13785) Massively refactors the config infrastructure, sorely needed and will be req'd for the lua stuff --- src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp | 3 +++ src/layout/algorithm/tiled/master/MasterAlgorithm.cpp | 10 ++++++---- src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp | 9 +++++---- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src/layout/algorithm') diff --git a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp index d7eaa61f..78ed9480 100644 --- a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp +++ b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp @@ -11,10 +11,13 @@ #include "../../../../Compositor.hpp" #include +#include using namespace Layout; using namespace Layout::Tiled; +using namespace Hyprutils::String; + struct Layout::Tiled::SDwindleNodeData { WP pParent; bool isNode = false; diff --git a/src/layout/algorithm/tiled/master/MasterAlgorithm.cpp b/src/layout/algorithm/tiled/master/MasterAlgorithm.cpp index 7696f66f..7017deb1 100644 --- a/src/layout/algorithm/tiled/master/MasterAlgorithm.cpp +++ b/src/layout/algorithm/tiled/master/MasterAlgorithm.cpp @@ -5,16 +5,18 @@ #include "../../../target/WindowTarget.hpp" #include "../../../../config/ConfigValue.hpp" -#include "../../../../config/ConfigManager.hpp" +#include "../../../../config/shared/workspace/WorkspaceRuleManager.hpp" #include "../../../../desktop/state/FocusState.hpp" #include "../../../../helpers/Monitor.hpp" #include "../../../../Compositor.hpp" #include "../../../../render/Renderer.hpp" #include +#include using namespace Layout; using namespace Layout::Tiled; +using namespace Hyprutils::String; struct Layout::Tiled::SMasterNodeData { bool isMaster = false; @@ -845,10 +847,10 @@ void CMasterAlgorithm::buildOrientationCycleVectorFromEOperation(std::vector("master:orientation"); - const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(m_parent->space()->workspace()); + const auto WORKSPACERULE = Config::workspaceRuleMgr()->getWorkspaceRuleFor(m_parent->space()->workspace()); std::string orientationString; - if (WORKSPACERULE.layoutopts.contains("orientation")) - orientationString = WORKSPACERULE.layoutopts.at("orientation"); + if (WORKSPACERULE && WORKSPACERULE->m_layoutopts.contains("orientation")) + orientationString = WORKSPACERULE->m_layoutopts.at("orientation"); else orientationString = *PORIENT; diff --git a/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp b/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp index 8a5b2d59..addd371d 100644 --- a/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp +++ b/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp @@ -8,12 +8,13 @@ #include "../../../../Compositor.hpp" #include "../../../../desktop/state/FocusState.hpp" #include "../../../../config/ConfigValue.hpp" -#include "../../../../config/ConfigManager.hpp" +#include "../../../../config/shared/workspace/WorkspaceRuleManager.hpp" #include "../../../../render/Renderer.hpp" #include "../../../../managers/input/InputManager.hpp" #include "../../../../event/EventBus.hpp" #include +#include #include #include @@ -1488,10 +1489,10 @@ SP CScrollingAlgorithm::dataFor(SP t) { } eScrollDirection CScrollingAlgorithm::getDynamicDirection() { - const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(m_parent->space()->workspace()); + const auto WORKSPACERULE = Config::workspaceRuleMgr()->getWorkspaceRuleFor(m_parent->space()->workspace()); std::string directionString; - if (WORKSPACERULE.layoutopts.contains("direction")) - directionString = WORKSPACERULE.layoutopts.at("direction"); + if (WORKSPACERULE && WORKSPACERULE->m_layoutopts.contains("direction")) + directionString = WORKSPACERULE->m_layoutopts.at("direction"); static const auto PCONFDIRECTION = CConfigValue("scrolling:direction"); std::string configDirection = *PCONFDIRECTION; -- cgit v1.2.3