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/target/WindowTarget.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/layout/target/WindowTarget.cpp') diff --git a/src/layout/target/WindowTarget.cpp b/src/layout/target/WindowTarget.cpp index bd94a8c9..3bc36c2a 100644 --- a/src/layout/target/WindowTarget.cpp +++ b/src/layout/target/WindowTarget.cpp @@ -4,11 +4,12 @@ #include "../algorithm/Algorithm.hpp" #include "../../protocols/core/Compositor.hpp" -#include "../../config/ConfigManager.hpp" +#include "../../config/shared/workspace/WorkspaceRuleManager.hpp" #include "../../helpers/Monitor.hpp" #include "../../xwayland/XSurface.hpp" #include "../../Compositor.hpp" #include "../../render/Renderer.hpp" +#include "../../desktop/state/FloatState.hpp" #include @@ -71,7 +72,7 @@ void CWindowTarget::updatePos() { // get specific gaps and rules for this workspace, // if user specified them in config - const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(PWORKSPACE); + const auto WORKSPACERULE = Config::workspaceRuleMgr()->getWorkspaceRuleFor(PWORKSPACE); if (!validMapped(m_window)) { if (m_window) @@ -107,8 +108,8 @@ void CWindowTarget::updatePos() { const bool DISPLAYINVERSERIGHT = STICKS(m_box.logicalBox.x + m_box.logicalBox.w, MONITOR_WORKAREA.x); static auto PGAPSINDATA = CConfigValue("general:gaps_in"); - auto* const PGAPSIN = sc((PGAPSINDATA.ptr())->getData()); - auto gapsIn = WORKSPACERULE.gapsIn.value_or(*PGAPSIN); + auto* const PGAPSIN = sc((PGAPSINDATA.ptr())->getData()); + auto gapsIn = (WORKSPACERULE && WORKSPACERULE->m_gapsIn.has_value()) ? WORKSPACERULE->m_gapsIn.value() : *PGAPSIN; const static auto REQUESTEDRATIO = CConfigValue("layout:single_window_aspect_ratio"); const static auto REQUESTEDRATIOTOLERANCE = CConfigValue("layout:single_window_aspect_ratio_tolerance"); @@ -264,7 +265,7 @@ std::expected CWindowTarget::desiredGeomet DESIRED_GEOM.y = xy.y; } - const auto STOREDSIZE = m_window->m_ruleApplicator->persistentSize().valueOrDefault() ? g_pConfigManager->getStoredFloatingSize(m_window.lock()) : std::nullopt; + const auto STOREDSIZE = m_window->m_ruleApplicator->persistentSize().valueOrDefault() ? Desktop::floatState()->get(m_window.lock()) : std::nullopt; if (STOREDSIZE) requested.size = clampSizeForDesired(*STOREDSIZE); -- cgit v1.2.3